XXIIVV

Uxntal stacks

In concatenative programming, there are no precedence rules, the calculations are merely performed in the sequence in which they are presented. The order with which elements come off a stack is known as last in, first out. In the stack a b c, the c item was the last to be added, and will be the first to be removed.

#01 #02 #03 ADD01 05

All programming in Unxtal is done by manipulating the working stack, and return stack. Each stack contains 255 bytes, items from one stack can be moved into the other. Here are some stack primitives and their effect:

POPa bDiscard top item.
NIPa cDiscard second item.
SWPa c bMove second item to top.
ROTb c aMove third item to top.
DUPa b c cCopy top item.
OVRa b c bCopy second item to top.

A byte is a number between 0-255(256 values), a short is made of two bytes, each byte in a short can be manipulated individually:

#0a #0b POP 0a
#12 #3456 NIP 12 56
#1234 DUP 12 34 34