Quote:
Originally Posted by phe
Does the Kenbak have a stack? Where is the equivalent "RET" instruction?
Paul
|
No, no stack on a Kenbak. The JMD (Jump and Mark Direct) instruction stores the value {program counter}+2 at the address in the operand, then jumps to the address {operand}+1. To return you do an unconditional JPI (Jump Indirect) using the start of the subroutine as the operand, which returns you to the instruction following the JMD. It's all pretty neat but it means you can't do recursion, of course