Mail Archives: djgpp/1997/12/04/18:16:17
Tan Pinghui wrote:
> Sorry, my previous mail (and this one) is off topic, it's not related to
> DJGPP.
... meaning that you were better off posting to another ng.
> The code segment is 32-bit, if I set the stack segment to 16-bit and do a
> "push 0x1000", is the stack pointer SS:ESP or SS:SP? is the value I pushed
> the word 0x1000 or the double word 0x00001000?
When SS is 16-bit (B-bit reset) the CPU always uses SP for instructions
implicitely addressing the stack. Whether the value you pushed is 16 or
32 bits depends on the addressing mode, which equals to the D-bit from
the current segment (CS) xor'ed with the presence of the operand size
prefix. Assuming you mean without an ads prfx, 0x00001000 is pushed.
This also means that this value is (or must be) encoded within the
instruction as 4 bytes rather than 2.
--
\ Vik /-_-_-_-_-_-_/
\___/ Heyndrickx /
\ /-_-_-_-_-_-_/
- Raw text -