[ Index
][ Back ][ Next ]
DUP
This will duplicate the top number on
the stack.
e.g.
719 DUP . . <CR>
will print 719 719 .
DROP
This will drop the number from the top
of the stack.
e.g.
111 222 DROP . <CR>
will print 111 .
SWAP
This will swap the two top numbers on
the stack.
e.g.
111 222 SWAP . . <CR>
will print 111 222 .
OVER
This will copy the second number on the
stack, making it a new number at the top of the stack without destroying the
other numbers.
e.g.
111 222 OVER . CR . CR . <CR>
will print
111
222
111
since the stack before
OVER was:
222
TOS
111
and after
OVER is
111
(copy)
222
111
ROT
This will rotate the top three numbers
on the stack, bringing the third number to the top of the stack.
e.g.
1 2 3 ROT . CR . CR . <CR>
will print
1
3
2
since the stack before
ROT was:
3
TOS
2
1
and
after ROT is
1
3
2
[ Index
][ Back ][ Next ] |