View Single Post
  #4  
Old 10-09-2007, 01:48 PM
Geoff Harrison Geoff Harrison is offline
Senior Member
 
Join Date: Feb 2007
Posts: 104
Default

Quote:
Originally Posted by phe View Post
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
Reply With Quote