|
|
|
|
|
STACK MANIPULATION
These are abbreviated details from the section WORD
LIST, grouped here for convenience.
-DUP
|
( 0 - 0 ) or ( n1 - n1 n1 )
|
|
-ROT
|
( n1 n2 n3 - n3 n1 n2 )
|
|
.S
|
( - )
|
Non-destructive display
of stack
|
2>R
|
( n1 n2 - )
|
Moves two nos. from stack to return stack
|
2DROP
|
( n1 n2 - )
|
|
2DUP
|
( n1 n2 -
n1 n2 n1 n2 )
|
|
2OVER
|
( d1 d2 -
d1 d2 d1 )
|
|
2R
|
( - n1 n2 )
|
Copies two nos. from return stack to stack
|
2R>
|
( - n1 n2 )
|
Moves two nos. from return stack to stack
|
2ROT
|
( d1 d2 d3
- d2 d3 d1 )
|
|
2SWAP
|
( n1 n2 n3
n4 - n3 n4 n1 n2)
|
|
><
|
( n1 - n2 )
|
n2 is n1 with its bytes swapped
|
>R
|
( n - )
|
Moves number from stack to return stack
|
DROP
|
( n - )
|
|
DUP
|
( n - n n )
|
|
I
|
( - n)
|
n is a copy of the current loop index
|
J
|
( - n)
|
Copies third number on the return stack to stack. Usually
used in the inner of two nested DO loops to access the index of the
outer loop.
|
NIP
|
( n1 n2 -
n2 )
|
|
OVER
|
( n1 n2 -
n1 n2 n1 )
|
|
PICK
|
( N - n )
|
Take the Nth item on the stack (not including N) and
place it on top of the stack.
|
2R
|
( - n1 n2 )
|
Copies two numbers from return stack to stack
|
R
|
( - n )
|
Copies number from return stack to stack
|
R>
|
( - n )
|
Moves number from return stack to stack
|
ROLL
|
( n - )
|
Copies nth item on stack to the top
|
ROT
|
( n1 n2 n3
- n2 n3 n1 )
|
|
RP!
|
( - )
|
Clear return stack
|
R0
|
( - addr)
|
User variable containing initial location of return stack
|
S0
|
( - addr)
|
User variable containing initial location of stack
|
SP!
|
( - )
|
Clear stack
|
SP@
|
( - addr )
|
Address of the uppermost
byte of top item on the stack before SP@ was executed
|
SWAP
|
( n1 n2 -
n2 n1 )
|
|
|
|