EB>You're correct. The stack pointer is decremented before the register is
EB>copied to memory.
EB>> SM> (assuming, of course, that mov ax,ss:[sp] worked ;)
EB>>
EB>>DG> Why wouldn't it?
EB>>
EB>>Did you try it? Microsoft's DEBUG says "error", and OpenDOS's DEBUG says
EB>>"Incorrect name of index register".
EB>That's because it's not a legal addressing mode. If you examine a chart
f
EB>the ModR/M byte addressing forms, you'll see that there is no way to
EB>specify [sp] as a destination address.
However, in 32-bit addressing modes, the SIB byte allows ss:[esp] as a
destination. So,
mov ss:[esp], eax
encodes as (hexidecimal, assuming a Use32 segment)
8B 04 24
((Cloud))
MauveCloud@juno.com
* OLX 2.2 * Chicken heads are the chief food of captive alligators.
--- PCBoard (R) v15.3/M 10
---------------
* Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205)
|