Other languages
Computer Science
Meta
Tal or Uxntal is a stack-based assembly language designed for the Uxn virtual machine. There are 256 instructions designed to work within a 16-bit addressing space.
@fib ( num* -- numfib* ) #0001 GTH2k ?{ POP2 JMP2r } SUB2k fib STH2 INC2 SUB2 fib STH2r ADD2 JMP2r
The Uxn specification provides Tal with two 256 bytes circular stacks and 64kb of RAM. The language features support for anonymous functions, and arity checking.
@on-reset ( -> ) #6400 &loop ( -- ) DUP <print-dec> #2018 DEO DUP #03 DIVk MUL SUB ?{ ;dict/fizz <print-str>/ } DUP #05 DIVk MUL SUB ?{ ;dict/buzz <print-str>/ } #0a18 DEO INC GTHk ?&loop POP2 ( exit ) #800f DEO BRK @<print-dec> ( num -- ) ( x0 ) DUP #0a DIV <print-num> ( 0x ) #0a DIVk MUL SUB ( >> ) @<print-num> ( num -- ) #30 ADD #18 DEO JMP2r @<print-str> ( addr* -- ) LDAk #18 DEO INC2 & LDAk ?<print-str> POP2 JMP2r @dict ( strings ) &fizz "Fizz $1 &buzz "Buzz $1
Uxn is a small stack-based computer with an implementation-first design. It is specialized for building small, low-energy, audio-visual applications. The specification for Uxn fits onto a single page, and its implementation is 100 lines of C. Finally, it powers the personal computing stack called Varvara.
This revision created on Wed, 6 Sep 2023 04:34:57 by CapitalEx (Create generalized quotations page.)