This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Krista,
Looking at your code and example breakdown, I think you have the description of what is going on correct, but your suppositions at the end are not correct.
I'll walk through your description in a little more detail to see if that helps clear up what is happening inside of the call instruction:
Krista Hill said:o SP-2 -> SP (pre-decrement SP)
Krista Hill said:o PC+2 -> @SP (write PC to address referred to by SP)
Krista Hill said:o X(PC) -> PC (use value after the instruction word to jump to new PC address)
Let me know if that helps clarify things.
Mike
Mike Pridgen said:... I think you have the description of what is going on correct, ...
I disagree. I think that code will not work. (Try it!)
I usually use "CALL #SUB1;"
I occasionally use "CALL PTR1;", "CALL &PTR1;" or "CALL Rn;", where PTR1 and Rn point to SUB1.
**Attention** This is a public forum