Re: A92: Using ASM in C (new message)


[Prev][Next][Index][Thread]

Re: A92: Using ASM in C (new message)




According to TurboSoft@aol.com:
> 
> 
> In a message dated 8/22/99 1:19:23 PM Eastern Daylight Time, 
> medlingn@zdnetmail.com writes:
> 
> > A random number would probably crash your program, although I've never 
> tried 
> > it myself
> 
> what l mean though is how do you know that n is supposed to start out at 8 
> and go up by 2's and not some other number?
> 
> 


It's a rule : 8(%sp) refer to the first argument passed to a function. Then,
to access the second argument you have to increase 8 by the size of the first
one. In our case, the first argument is 2 byte (the int type in tigcc), so
the second argument is located at 10(%sp), and so on.

Hope I was clear...

-- 

    Jean-Baptiste CANAZZI
    bloozed@multimania.com
    http://www.multimania.com/bloozed


References: