added NIP instruction

This commit is contained in:
sejo 2021-08-16 16:03:14 -05:00
parent 4da4da60f9
commit 790e9481be
1 changed files with 3 additions and 2 deletions

View File

@ -362,15 +362,16 @@ so far we have been using the stack as a place to store operands of instructions
## stack instructions
uxntal has five instructions that act upon the elements in the stack:
uxntal has six instructions that act upon the elements in the stack:
* POP: Remove top element from the stack ( a -- )
* DUP: Duplicate; push a copy of the top element ( a -- a a )
* SWP: Swap; change the order of the top two elements of the stack ( a b -- b a )
* NIP: Remove the top second element of the stack ( a b -- b )
* OVR: Over; push a copy of the second top element ( a b -- a b a )
* ROT: Rotate; reorder the top three elements of the stack so that the third one is now at the top ( a b c -- b c a )
in short mode, POP2, DUP2, SWP2, OVR2 and ROT2 perform the same actions but using shorts instead of bytes.
in short mode, POP2, DUP2, SWP2, NIP2, OVR2 and ROT2 perform the same actions but using shorts instead of bytes.
## examples