Concatenative language
Concatenative topics
Concatenative meta
Other languages
Meta
[[https://wiki.xxiivv.com/site/uxntal.html|Tal or Uxntal]] is a stack-based assembly language for the [[https://wiki.xxiivv.com/site/uxn.html|Uxn]] virtual machine designed to work within a 16-bit addressing space. It is a small stack-based computer specialized for building small, low-energy, audio-visual applications with a napkin-size specification and implementation in [[https://wiki.xxiivv.com/etc/uxnmin.c.txt|100 lines of C]]. Finally, it powers the personal computing stack called [[https://wiki.xxiivv.com/site/varvara.html|Varvara]]. [{@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 [[Quotations|anonymous functions]], and [[arity checking]]. === FizzBuzz Implementation === [{#6400 @fizzbuzz ( n i -- ) LITr 00 DUP #03 DIVk MUL SUB ?{ INCr ;&f str/print } DUP #05 DIVk MUL SUB ?{ INCr ;&b str/print } LITr _{ JCNr dec/print } #0a18 DEO INC GTHk ?fizzbuzz POP2 BRK &f "Fizz $1 &b "Buzz $1 @dec/print ( n -- n ) DUPk #0a DIV /d #0a DIVk MUL SUB &d #30 ADD #18 DEO JMP2r @str/print ( s* -- ) LDAk #18 DEO INC2 LDAk ?&print POP2 JMP2r}]
Describe this revision:
Save