From: Macomson, W. <wis...@in...> - 2013-01-31 20:37:38
|
I'm new to this and I'm trying to understand the amForth inner interpreter. There are a couple of clarifications in the "amforth Documentation, Release 5.1-wip,January 26, 2013" that would help a lot. To wit: (p. 9) EXECUTE Q: When is EXECUTE, um, executed? I'm not clear on what this is used for. (p. 9) NEXT [ . . . ] This last step finally jumps to the machine code pointed to by the X scratch pad register. Q: To be clear, the machine code jumps to NEXT when it has completed. Correct? (p. 9) EXIT The code for EXIT (aka UNNEST) is the forth word EXIT in the dictionary. It reads the IP from the return stack and jumps to NEXT. The return stack pointer is incremented by 2 (1 flash cell). Q: I think EXIT pops the top of the return stack into the IP. That way, the second step of NEXT gets the correct value. Correct? (p. 9) DO_DOES This code is the runtime part of the forth word DOES> . It pushes the current address of the MCU IP register onto the returnstack and jumps to DO_DOES. DO_DOES gets that address back, saves the current IP and sets the forth IP to the address it got from the stack. Finally it continues with NEXT. Q. Is this effectively a subroutine call? Thanks for any light you can shed. |