TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: ARNOUD BAKKER
from: BRIAN MCCLOUD
date: 1997-07-01 15:38:00
subject: Huh?

AB>This is the first bit of code from a programm :
AB>MOV BP,AX
AB>MOV AX,ES
AB>ADD AX,10h
AB>What is stored in AX that the maker want's to keep?
AB>ES is the segment of the PSP, right?
(from the book "PC Interrupts" by Ralf Brown & Jim Kyle)
New executables begin running with the following register values:
AX      = environment segment
BX      = offset of command tail in environment segment
CX      = size of automatic data segment
ES, BP  = 0000h
DS      = automatic data segment
SS:SP   = initial stack
(from the TASM user's guide)
When you load an EXE program, the operating system sets up the registers as
follows:
DS, ES  = PSP segment
CS:IP   = start address
SS:SP   = stack address
I think AX may also be loaded for the second one, which specifies the PSP.  
n
the newer executable types as above, the PSP in real mode can be found by
subtracting 0010h from the value of CS.
((Cloud))
MauveCloud@juno.com
 * OLX 2.2 * Words are not food, though sometimes we must eat them.
--- PCBoard (R) v15.3/M 10
---------------
* Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.