Re: A89: placing data into C variables from ASM(" ") constructs


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

Re: A89: placing data into C variables from ASM(" ") constructs




Niklas Brunlid writes:
 > D'oh! And it makes no difference if the functions has no arguments, either?

No. This is how it looks (if you have monospace font :-) when you have 

foo( int a, int b );
bar( void );
baz( int x );

and baz calls bar which calls foo:

SP -> +--------+
      | locals | 
	  | of foo |
A6 -> +--------+
      | link   | 
      +--------+\  
      | retaddr| \ 
      +--------+  |
      |   a    |  |
      +--------+  V
      |   b    |  |
      +--------+  |
      | locals |  |
      | of bar |  |
      +--------+  |
      | link   |<-+
      +--------+\
      | retaddr| \
      +--------+  |
      | locals |  |
      | of baz |  V
      +--------+  |
      | link   |<-+
      +--------+\
      | retaddr| \
      +--------+  |
      |   x    |  V
      
 > Sounds about right... thanks.

Any time.

Regards,

Zoltan


References: