01-02-2011, 10:05 PM
(31-01-2011, 09:55 PM)Pack3t SynAck3r Wrote: I can understand how that thought process could be formulated. When I learned assembly originally all I did was manipulate cpu register data, and therefore I was "taught" to deal with the stack first and to draw concern about it. Usually the concern is unnecessary because often when your code is compiled all of it is pretty much handled at compile time. Buffer overflows are engineered often take advantage of the assumed variable that we leave to chance.
Oops double posted! Wanted Pack3t to see the new addition and we shall call this a BUMP!
'Pretty much' handled at compile time- I was using a cartridge-that's right, cartridge. I don't is compiler was very smart- my guess was it was merely replacing the asm instructions for opcode, plus whatever variables used. My understanding of the overflow was that an overflow flag bit was triggered and the stack pointer went back to zero. Then if you pull from the stack you get whatever you put there a zillion time units ago or you pushed new values in the midst of the old ones. I can't remember if you could move the pointer any direction you wanted without load accumulator with the value you want the stack pointer to become then STA in stack pointer. That adds 2 more instructions! Most instructions take at least 2 cpu cycles. The processor I was using was 2 mhz. Which means I would have to wait a half a millionth of a second! I don't have that kind of time! That's wasteful! I am going to snap! Anywho, seemed like I thought it would be much easier to use the x index or y index since I almost had the same power with those as I did with the all-powerful accumulator!
Having long hair is great until you have to pull a footlong out of the dog's butt. flatank.blogspot.com
I. AM. LATCH.
I. AM. LATCH.