Jax4th for the Commodore Amiga is Copyright 1991, 1993, 1994 Jack J. Woehr This is free software, and may be redistributed under certain conditions. See the file COPYING.TXT for more information. Jax4th comes with ABSOLUTELY NO WARRANTY Jax4th Internals ---------------- Execution Tokens All execution tokens are thirty-two bits and are passed in the form (K|(offset>>1)) where K, bit D31 of the token, if set indicates that the execution token refers to the kernel and if not set indicates that the execution token refers to the local code image; and where (offset>>1) is the offset of the execution body in the given image logically shifted right one bit. Kernel Addresses Kernel addresses are thirty-two bits and are passed as offsets from the address pointed to by the Code Pointer (CP). As the kernel is re-entrant, all data addresses used by the kernel refer to the same local data section as those referenced by the local code image. Local Code Addresses Addresses in the Local Code Image are thirty-two bits and are passed as offsets from the address pointed to by the Next Pointer (NP). The beginning of the local code image contains a copy of the NEXT routine. Data Addresses Data addresses are thirty-two bits and are passed as offsets from the address pointed to by the Base Pointer (BP). As the kernel is re-entrant, all data addresses used by the kernel refer to the same local data section as those referenced by the local code image. Stack Addresses Each time a reentrant resident program is invoked, the AmigaDOS loader gives it its own stack, usually of about 4000 bytes. In JAX4TH, a portion of this stack is consumed by startup overhead. The rest is divided approximately equally between return stack and data stack. Forth Top of Data Stack is cached in D7 (TOS) and the rest of the stack is pointed to by A7 (DSP). A6 is the Return Stack Pointer (RP). Forth words referencing the addresses contained in the stack pointers consume and return Data Segment relative addresses. Of course, the stack pointers themselves contain machine addresses. Instruction Pointer The Forth Instruction Pointer contains a machine address. NEXT examines each instruction as fetched from the cell currently pointed at by IP and decides if the token contained therein is a resident-kernel-relative address or a local-code-relative address before branching. NEST preserves the current IP on the Return Stack and reloads IP with a machine address.