<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Wed, 25 Nov 2009 02:19:21 +0100
From   : rick@... (Rick Murray)
Subject: Quine

Mick Champion wrote:

> Got you! So a dodgy sub-routine could plant something else in the stack 
> and cause problems if it then leaves it there.

:-) This isn't ARM code where the "stack" can be tossed away.

If you leave so much as a single byte (or take one too many), then the 
stack will be out of sync for everything. Absolutely everything that 
pushed data to the stack will whinge and whine and freak out.

But you probably won't notice, as JSR pushes two bytes to the stack 
which is used as the return address. If the wrong two bytes are read 
back... bang!


Best wishes,

Rick.

-- 
Rick Murray, eeePC901 & ADSL WiFI'd into it, all ETLAs!
BBC B: DNFS, 2 x 5.25" floppies, EPROM prog, Acorn TTX
E01S FileStore, A3000/A5000/RiscPC/various PCs/blahblah...
 >> TO PRIVATE MAIL ME, REMOVE [BBC-Micro] FROM SUBJECT <<
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>