<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>


Words in category Stack Words in glossary TurboForth Kernal

Search:
The following words are listed in this category (16 words found): Word Types: S = Standard, I = Immediate , IC = Immediate-compiling.
Word Name Word Type Data Stack Signature Return Stack Signature Description Availability
V1.0 V1.1 V1.2
.S S -- -- Non-destructively displays the contents of the stack.
?DUP S a -- a | a a -- Duplicates the topmost item if it is not 0.
>< S n -- n -- Swaps bytes in a cell. E.g. 0x1234 becomes 0x3412.
2DROP S a b -- -- Discards the topmost two cells.
2DUP S a b -- a b a b -- Duplicates the topmost two cells.
DEPTH S -- depth -- Places the count of the number of cells on the stack on the stack.
DROP S n -- -- Discards the topmost cell.
DUP S n -- n -- Duplicates the topmost cell.
NIP S a b -- b -- Discards the second cell (cell a). Equivalent to SWAP DROP.
OVER S a b -- a b a -- Copies the second cell to the top. 1 2 becomes 1 2 1.
PICK S n  Nth -- Copies stack cell number n to the top of the stack.
ROLL S +n -- n -- Rolls the stack left +n items. Items rolled out to the left wrap around to the top of the stack.
ROT S a b c -- b c a -- Rotates the top 3 items to the left. The 3rd item rotates into the top position. 1 2 3 becomes 2 3 1.
-ROT S a b c -- c a b -- Rotates the top 3 items to the right. The topmost item rotates into the 3rd position. 1 2 3 becomes 3 1 2.
SWAP S a b -- b a -- Swaps the topmost two cells. 1 2 becomes 2 1
TUCK S a b -- b a b -- Copies the top cell into the 3rd position, moving the stack forward. 1 2 becomes 2 1 2.

<< Home | About Forth | About TurboForth | Download | Language Reference | Resources | Tutorials | YouTube >>