The file 68K\MIN68K.FTH contains the minimum code definitions required to support Umbilical Forth. If additional definitions are required, they may be copied to a new file from 68K\CODE68K.FTH or COMMON\KERNEL62.FTH.
CODE (DO) \ limit index --
The run time action of DO compiled on the target.
CODE (?DO) \ limit index --
The run time action of ?DO compiled on the target.
CODE EXECUTE \ xt --
Execute the code described by the XT. This is a Forth equivalent to an assembler JSR/CALL instruction.
Code Noop \ -- ; used by multi-tasker
A NOOP, null instruction. )
CODE MIN \ n1 n2 -- n'
Given two data stack items preserve only the smaller.
CODE MAX \ n1 n2 -- n1|n2
Given two data stack items preserve only the smaller.
CODE WITHIN? \ n1 n2 n3 -- flag
Return TRUE if N1 is within the range N2..N3. This word uses signed arithmetic.
CODE DNEGATE \ d1 -- d2
Negate a double number.
CODE ?NEGATE \ n1 flag -- n1|n2
If flag is negative, then negate n1.
CODE ?DNEGATE \ d1 flag -- d1|d2
If flag is negative, then negate d1.
CODE D+ \ d1 d2 -- d3
Add two double precision integers.
CODE D- \ d1 d2 -- d3
Subtract two double precision integers. D3=D1-D2.
Different multiply and divide routines are compiled according to the setting of equate CPU32? which should be set non-zero for CPU32 CPUs such as the 68332 which have enhanced multiply and divide instructions.
CODE UM* \ u1 u2 -- ud
Perform unsigned-multiply between two numbers and return double result.
CODE * \ n1 n2 -- n3
Standard signed multiply. N3 = n1 * n2.
CODE M* \ n1 n2 -- d3
Signed multiply yielding double result.
CODE UM/MOD \ ud u -- urem uquot
Perform unsigned division of double number UD by single number U and return remainder and quotient.
CODE FM/MOD \ d1 n2 -- rem quot ; symmetric division
Perform a signed division of double number D1 by single number N2 and return remainder and quotient using floored division. See the ANS Forth specification for more details of floored division.
CODE SM/REM \ d1 n2 -- rem quot ; symmetric division
Perform a signed division of double number D1 by single number N2 and return remainder and quotient using symmetric (normal) division.
code /mod \ n1 n2 -- rem quot ; 6.1.0240
Signed division of N1 by N2 single-precision yielding remainder and quotient.
code / \ n1 n2 -- quot ; 6.1.0230
Standard signed division operator. n3 = n1/n2.
code mod \ n1 n2 -- rem ; 6.1.1890
Return remainder of division of N1 by N2. n3 = n1 mod n2.
: */MOD \ n1 n2 n3 -- rem quot
Multiply n1 by n2 to give a double precision result, and then divide it by n3 returning the remainder and quotient. The point of this operation is to avoid loss of precision.
: */ \ n1 n2 n3 -- n4
Multiply n1 by n2 to give a double precision result, and then divide it by n3 returning the quotient. The point of this operation is to avoid loss of precision.
: M/ \ d n1 -- n2
Signed divide of a double by a single integer.
: MU/MOD \ d n -- rem d#quot
Perform an unsigned divide of a double by a single, returning a single remainder and a double quotient.
CODE SP@ \ -- x
Get the current address value of the data-stack pointer.
CODE SP! \ x --
Set the current address value of the data-stack pointer.
CODE RP@ \ -- x
Get the current address value of the return-stack pointer.
CODE RP! \ x --
Set the current address value of the return-stack pointer.
CODE ROLL \ xu xu-1 .. x0 u -- xu-1 .. x0 xu
Rotate the order of the top N stack items by one place such that the current top of stack becomes the second item and the Nth item becomes TOS. See also ROT.
CODE ON \ a-addr --
Given the address of a CELL this will set its contents to TRUE (-1).
CODE OFF \ a-addr --
Given the address of a CELL this will set its contents to FALSE (0).
CODE 2@ \ a-addr -- x1 x2
Fetch and return the two CELLS from memory ADDR and ADDR+sizeof(CELL). The cell at the lower address is on the top of the stack.
CODE 2! \ x1 x2 a-addr --
Store the two CELLS x1 and x2 at memory ADDR. X2 is stored at ADDR and X1 is stored at ADDR+CELL.
CODE c+! \ b addr --
Add N to the character (byte) at memory address ADDR.
CODE COUNT \ c-addr1 -- c-addr2' u
Given the address of a counted string in memory this word will return the address of the first character and the length in characters of the string.
CODE CMOVE \ c-addr1 c-addr2 u --
Copy U bytes of memory forwards from C-ADDR1 to C-ADDR2.
CODE CMOVE> \ c-addr1 c-addr2 u --
As CMOVE but working in the opposite direction, copying the last character in the string first.
CODE FILL \ c-addr u char --
Fill U bytes of memory starting at C-ADDR with the byte information specified as CHAR.
CODE (") \ -- a-addr ; return address of string, skip over it
Return the address of a counted string that is inline after the CALLING word, and adjust the CALLING word's return address to step over the inline string. See the definition of (.") for an example.
: (C") \ -- c-addr
The run time action compiled by C".
: (S") \ -- c-addr u
The run time action compiled by S".
chere is-action-of constant
The runtime code for a CONSTANT.
chere is-action-of variable
The runtime code for a VARIABLE.
chere is-action-of user
The runtime action of a USER variable.
: CRASH \ -- ; used as action of DEFER
The default action of a DEFERed word. A NOOP.
chere is-action-of DEFER \ Comp: "<spaces>name" -- ; Run: i*x -- j*x
The runtime action of a DEFERred word.