uxntal

uxntal is the de facto standard programming language for the uxn virtual machine. Its design uses a shallow embedding of the underlying virtual machine's model, with a majority of program text often being named use of virtual machine instructions.
Designed as a thin language on a base of named instruction, its ahead-of-time compiled implementation is in the practical class of macro assembler.
Its practice often involves use of the varvara computer system extension to the virtual machine, which includes standard interfaces for external resource interaction (e.g. screen drawing, system time).
syntax
- is not to be confused with a uxntal specification,
- are valid syntactic constructions,
- is a conservative subset of valid all syntactic constructs,
- are not always meaningful,
- and rarely follow idioms of the language as used.
program
The generative grammar is given in a Bachus-Naur Form with two extensions.
First, as notation shorthands, take ␣
to be any amount of whitespace separation,
<hex1>
to be any hexadecimal character 0
–f
,
and <hexn>
a string of n
hexadecimal characters (e.g., <hex2>
encoding 00
–ff
, a byte).
Second, uxntal naming forms are defined as being not something, which resists BNF expression: instead, take as given:
- a
<STRING>
is anything but its closing␣
- a
<COMMENT>
is anything but its closing␣)
- an
<ID>
is anything but the finite sets<opcode>
and reserved hexadecimal strings<hex1>
<hex2>
<hex3>
<hex4>
.
<program> | = | concatenating |
| | <program>␣<program> | |
operation | ||
| | <opcode> | |
assembler control | ||
| | $<ID> | |
| | $<hex1> | |
| | $<hex2> | |
| | $<hex3> | |
| | $<hex4> | |
| | |<ID> | |
| | |<hex1> | |
| | |<hex2> | |
| | |<hex3> | |
| | |<hex4> | |
literals | ||
| | <ID> | |
| | <hex2> | |
| | "<STRING> | |
| | #<hex2> | |
| | #<hex4> | |
referencing | ||
| | ,<refer> | |
| | _<refer> | |
| | .<refer> | |
| | ~<refer> | |
| | ;<refer> | |
| | =<refer> | |
defining IDs | ||
| | %<ID>␣{␣<program>␣} | |
| | @<ID>␣<program> | |
| | &<ID>␣<program> | |
bracketing | ||
| | [␣<program>␣] | |
| | (␣<COMMENT>␣) | |
lambda):
<refer> | = | <ID> |
| | {␣<program>␣} | |
opcode
<core-opcode> | = | arithmetic |
| | INC | ADD | SUB | |
| | MUL | DIV | SFT | |
| | AND | ORA | EOR | |
test conditionals | ||
| | EQU | NEQ | |
| | GTH | LTH | |
stack combinators | ||
| | POP | NIP | |
| | DUP | OVR | |
| | ROT | STH | |
memory & I/O | ||
| | LIT | DEI | DEO | |
| | STZ | STR | STA | |
| | LDZ | LDR | LDA | |
jumps & control flow | ||
| | JMP | JCN | JSR | |
<core-opcodes>
are extended with four additional forms, and by modesuffixes:
<opcode> | = | BRK |
| | JCI | JMI | JSI | |
| | <core-opcode> | |
| | <core-opcode>2 | |
| | <core-opcode>k | |
| | <core-opcode>r | |
| | <core-opcode>2k | |
| | <core-opcode>2r | |
| | <core-opcode>kr | |
| | <core-opcode>2kr | |
versioning schema
memory expansion
the uxntal memory model uses, as its base, 16b pointers for 64KiB of total addressable memory.references
uxntal
- XXIIVV project home page. the logo included is licensed under CC BY-NC-SA 4.0.
- opcodes