TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: ED BEROSET
from: BRIAN MCCLOUD
date: 1998-02-02 05:25:00
subject: Re: Directly writing to m

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)

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™.