TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: DARRYL GREGORASH
from: JASEN BETTS
date: 1998-02-07 13:05:00
subject: Directly writing to memor

DG> Setting SP 2 bytes above  is something I never thought of,
DG> and would work in all situations.. unless, of course, one is working
DG> with an XT, in which case SP is decremented after the write.
actually on an XT it's decremented before the write,  and the new v
alue is stored at SS:(SP) I just tested it.
on my 486 the old (un-decremented) value is stored at the new
(decremented) address.
in other words...
 start with SP=FFEE , then do push SP
 xt   SS:[FFEC] = FFEC
 486  SS:[FFEC] = FFEE
 end with SP=FFEC
Someone said you could initialise SP to 2 bytes _past_ then end of
stack segment and then push a Dword, I don't think that'll work
because the cpu will attempt to write the last 2 bytes of the dword
past the end of the stack segment, (won't that cause a SEGV and
that'll cause a double-fault :) ) i think pointing to the first
non-stack-segment asddress is the highest you can go with SP.
                        
--- EzyQwk V1.20
---------------
* Origin: CSS Brisbane, Qld, Australia. (61-7-3367-3890) (3:640/350)

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