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

Replying to a message of Jasen Betts to DARRYL GREGORASH:
 DG>> That means nothing can ever be written onto the bottom of
 DG>> the stack, ye has always struck me as rather odd..
 JB> no since different sized things can go onto the stack...
Forget about the calls and ints.. when you decrement the stack pointer, then 
write to the stack, nothing can be written onto the bottom of the stack. 
Period. OTOH, if you write first, then decrement, you have problems with 
stack overflow, unless you are using a counter somewhere to keep track of the 
number of items in the buffer (whether that is a queue or a stack, it does 
not matter).
 JB> it also menas SP can be initialised to 0 and the first push
 JB> will write to bytes FFFF & FFFE
Are you really sure of that? I'm not going to check, but more likely it will 
trigger a stack exception; it certainly will in 32-bit mode.
Besides, most people are not in the habit of allocating a 64K stack.. *and* 
such segment wrap may or may not happen on anything but an 8088 or 286.. I 
don't recall if segment wrap is a feature of the 386+ 16-bit mode.. in any 
event, IMO it is shoddy programming practice to rely on something like that.
--- FleetStreet 1.21 NR
---------------
* Origin: BIG BANG Burger Bar: Regina SK Canada (1:140/86)

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