??? 06/25/08 07:16 Read: times |
#156187 - this is a poor practice... Responding to: ???'s previous message |
... you should not fiddle around with subroutines like this, as you get easily lost in the mess your program will become later. You should return from the subroutine with a return value (e.g. carry bit set or cleared, or similar) and you should check that in the calling routine.
Nevertheless, this IS possible, you need to throw away the return address (not "pointer") from top of the stack. If you don't push anything into the stack explicitly in your subroutine, you can simply pop to accumulator or any other scratch-byte twice, and you are done and can jump wherever you wish (but I keep repeating, it's a bad bad thing to do generally). Note, that even if you would leave the return address at the stack, it will not cause a correctly written rest of program return to the compare subroutine - it will simply remain in the stack, wasting those 2 bytes from the precious internal RAM. JW |
Topic | Author | Date |
jump from a subroutine? | 01/01/70 00:00 | |
this is a poor practice... | 01/01/70 00:00 | |
this? | 01/01/70 00:00 | |
Why do you want to do this?! | 01/01/70 00:00 | |
this is how to do it without resorting to ...![]() | 01/01/70 00:00 |