Rostiger's Uxn Zine16X08 A programming language for the Uxn virtual machine. Uxn programs are written in a stack-based flavor of assembly designed especially for a portable virtual machine. To get started, see the Quick Setup. Introduction In stack programming there are no variables and no precedence rules, the calculations are merely performed in the sequence in which they are presented. The order with which elements come off the 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 DUP ADD #03 MUL program 01 01 02 03 06 stack 01 02 Numbers in Uxntal are not decimal, they are expressed in hexadecimal. Which means that counting goes like: one, two, three, four, five, six, seven, eight, nine, ha, be, ce, de, he, fe, ten! It takes some getting used to, but don't worry, you'll get the hang of it. Now, without further ado.. Let's dive into it! The following example program prints the phrase "Hello World!" by pushing the address to a label on the stack, and iterating through each letter found at that address with a loop that increments the pointer until it reaches end of the phrase, at which point, the stack is emptied and the evaluation halts. A word starting with @ defines a label, and one starting with ; pushes the absolute address of a label to the stack. With that in mind, ;text pushes the two bytes equal to the address of the @text label to the stack. In the interpreter above, press "step" to walk through each step of the evaluation. Next, we define a new label named @while, to mark the start of the loop that will print each character stored at the text label. The LDAk opcode loads a byte at the address currently at the top of the stack, in this case, the ascii letter H(48). The k-mode indicates that the operator will not consume the address. The DUP opcode makes a copy of the letter. The ?{ pops that letter from the stack, and if it is not zero, we jump to the corresponding }, which ...
First seen: 2025-10-01 15:43
Last seen: 2025-10-01 21:45