Pointers and references: Difference between revisions
Content added Content deleted
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) |
||
Line 16: | Line 16: | ||
LDA $0101,X ;load the byte most recently pushed on the stack into A without pulling it off the stack.</lang> |
LDA $0101,X ;load the byte most recently pushed on the stack into A without pulling it off the stack.</lang> |
||
Note that in a subroutine, the value at <code>$0101,x</ |
Note that in a subroutine, the value at <code>$0101,x</code> is typically the low byte of the program counter, plus 1. It may be different depending on how many registers you pushed onto the stack prior to entry as well. In this example, we'll look at a hand-written translation of the following [[C]] function: |
||
<lang C>inline char foo (char a, char b, char c){ |
<lang C>inline char foo (char a, char b, char c){ |
||
return a+b+c; |
return a+b+c; |