Words

SWAP DUP 2DUP DROP 2DROP NIP TUCK OVER ROT -ROT ?DUP DEPTH NEGATE AND OR NOT XOR + * / /MOD MOD - 1+ 1- 2+ 2- CELL+ CELL- CELLS C@ W@ @ C! W! ! -! +! C, W, , \ #! ( [ ] WITHIN RECURSE HEX DECIMAL = < > u< >= <= ALLOT LSHIFT RSHIFT

59 words described












SWAP ( x1 x2 -- x2 x1 )
Exchange TOS and NOS:
( 8 2 -- 2 8 )
DUP ( x1 -- x1 x1 )
Duplicates TOS.
2DUP ( x1 x2 -- x1 x2 x1 x2 )
Duplicates TOS and NOS.
DROP ( x1 -- )
Drops TOS.
2DROP ( x1 x2 -- )
Drops TOS and NOS.
NIP ( x1 x2 -- x2 )
Drops NOS.
TUCK ( x1 x2 -- x2 x1 x2 )
Makes a copy of TOS and places this behind NOS.
OVER ( x1 x2 -- x1 x2 x1 )
Makes a copy of NOS and pushes this.
ROT ( x1 x2 x3 -- x2 x3 x1 )
Moves the third stack number to the top.
In other words: The three stack numbers are rotated left (x1 dumps out => comes in).
-ROT ( x1 x2 x3 -- x3 x1 x2 )
Moves TOS to the third position.
In other words: The three stack numbers are rotated right.
?DUP ( x1 -- | x1 x1 )
Duplicates TOS if TOS is not equal to FALSE.
Examples:
CODE			STACK AFTER
20 ?DUP			20 20
0 ?DUP			
DEPTH ( -- u1 ) ||DEPRECATED||
u1 = number of numbers on the data stack (Not including u1).
NEGATE ( x1 -- x2 )
Takes the 2. Complement of x1.
AND ( u1 u2 -- u3 )
Bitwise and of u1 and u2.
OR ( u1 u2 -- u3 )
Bitwise or of u1 and u2.
NOT ( u1 -- u2 )
u2 is the 1. Complement of u1.
XOR ( u1 u2 -- u3 )
Bitwise xor of u1 and u2.
+ ( n1 n2 -- n3 )
Add n2 to n1.
* ( u1 u2 -- u3 )
Multiply n1 by n2.
/ ( u1 u2 -- u3 )
Dividide n1 by n2.
/MOD ( u1 u2 -- u3 u4 )
Performs the action: n1 / n2
n3 = remainder
n4 = quotient
MOD ( n1 n2 -- n3 )
n3 is the remainder of n1 dividided by n2.
- ( n1 n2 -- n3 )
Substract n2 from n1.
1+ ( x1 -- x2 )
Add 1 to TOS.
1- ( x1 -- x2 )
Substract 1 from TOS.
2+ ( x1 -- x2 )
Add 2 to TOS.
2- ( x1 -- x2 )
Substract 2 from TOS.
CELL+ ( x1 -- x2 )
Add the size of a cell to TOS.
CELL- ( x1 -- x2 )
Substract the size of a cell from TOS.
CELLS ( x1 -- x2 )
Multiply TOS by the size of 1 cell.
C@ ( a1 -- x1 )
Load byte from memory location in TOS.
W@ ( a1 -- x1 )
Load word from memory location in TOS.
@ ( a1 -- x1 )
Load dword from memory location in TOS.
C! ( x1 a1 -- )
Store byte 'x1' at memory location in TOS.
W! ( x1 a1 -- )
Store word 'x1' at memory location in TOS.
! ( x1 a1 -- )
Store dword 'x1' at memory location in TOS.
-! ( x1 a1 -- )
Substract 'x1' from value at memory location in TOS.
+! ( x1 a1 -- )
Add 'x1' to value at memory location in TOS.
C, ( x1 -- )
Store 'x1' at current value of the here variable, as byte and advance here pointer.
W, ( x1 -- )
Store 'x1' at current value of the here variable, as word and advance here pointer.
, ( x1 -- )
Store 'x1' at current value of the here variable, as dword and advance here pointer.
\ ( -- )
Skip rest of current line, advances the tib pointer to just after the first newline (ascii 10).
Used to write comments.
#! ( -- )
Skip rest of current line, advances the tib pointer to just after the first newline (ascii 10).
Used to write comments and intepreter names.
( ( -- )
Skip input until ')' is found, advances the tib pointer to just after ')'.
Used to write stack comments.
[ ( -- )
Switch to interpret mode.
] ( -- )
Switch to compilation mode.
WITHIN ( u1 u2 u3 -- f )
Compares the value 'u1' against a range 'u2 to u3'.
f = u1 IN [u2;u3[
Where '[' is a closed group and ']' is an open group.
I`m not sure that "group" is the correct word in english math?

Said in another way: u2 <= u1 < u3
RECURSE ( -- )
JMP to the start of the current word definition.
HEX ( -- )
Change the conversion routine to use hex.
DECIMAL ( -- )
Change the conversion routine to use decimal.
= ( u1 u2 -- f )
Is NOS equal to TOS?
< ( n1 n2 -- f )
Is NOS less than TOS?
> ( n1 n2 -- f )
Is NOS greater than TOS?
u< ( u1 u2 -- f )
Is NOS greater than TOS, threating the values as unsigned integers?
>= ( n1 n2 -- f )
Is NOS greater than or equal to TOS?
<= ( n1 n2 -- f )
Is NOS less than or equal to NOS?
ALLOT ( u1 -- )
Advances the internal memory by 'u1' bytes, these bytes from HERE to HERE+'u1' will now not be used by new definitions.
Is uses to reserve memory for variables or any related usage.
LSHIFT ( u1 u2 -- u3 )
Shifts 'u1' left by 'u2' positions, leaving 'u3' (the result) on the stack.
RSHIFT ( u1 u2 -- u3 )
Shifts 'u1' right by 'u2' positions, leaving 'u3' (the result) on the stack.
( -- )