Uxntal: A programming language for the Uxn virtual machine
19 hours ago
- #stack-based
- #virtual-machine
- #assembly
- Uxn is a portable virtual machine with a stack-based assembly language called Uxntal.
- Uxntal programs manipulate two stacks (working and return) with operations like POP, DUP, SWP, etc.
- Numbers in Uxntal are hexadecimal, and the language uses labels, macros, and immediate opcodes.
- Uxntal has a memory model with 64KB addressable space, zero-page for fast access, and device I/O ports.
- The language includes utilities like assemblers (Drifblim), formatters (Uxnfor), and validators (Uxnbal).
- Uxn programs start execution at the reset vector (0x0100) and can handle events via device vectors.
- Uxntal supports stack manipulation, arithmetic, bitwise operations, and memory access with modes (2, k, r).
- Labels, macros, and anonymous blocks ({}) are used for control flow and code organization.
- Uxn's memory is big-endian, and the zero-page (below 0x0100) is preserved during soft reboots.
- The language is non-interruptible, with vectors for event handling (e.g., mouse movements).