6.2 KiB
Uxn
{ WIP, researching this etcetc. ~drummyfish }
Uxn is a minimalist self hosted stack-based virtual machine 8bit/16bit computer aiming for great simplicity and portability. It is quite nice and impressive, having its own instruction set, assembly language, many implementations and many programs written for it already (e.g. Left text editor, Noodle drawing tool etc.); it was made by the author of xxiivv wiki (some weird narcissist self proclaimed artist that's sailing the seas or something). From the minimalist point of view uxn really seems to be going in the right direction, it is inspired by old computers such as NES and C64, practicing real minimalism (not just pseudominimalism or just "lightweight minimalism") -- that's pretty awesome -- however its presentation is shit and while there are many free as in freedom implementations of uxn, official supplemental material to uxn (on the xxiivv wiki), such as its specification, is proprietary (NC) and therefore should be avoided and boycotted.
Uxn can be compared to some of our projects, for example SAF, but mainly comun -- the goals of uxn and comun may be seen as significantly overlapping, aiming to create a minimalist, completely independent from-ground-up computing "stack", an extremely portable platform for minimalist programs, and they do so in a similar way (both are e.g. stack based, inspired by Forth). To quickly compare uxn and comun: comun is more of a pure programming language focusing only on expressing algorithms without talking about I/O or instruction sets, uxn on the other hand really is a computer (even if initially only virtual), one that comes with its own instruction set, language and protocols for communication with peripheral devices, though the computer is purposefully made so that it can be implemented as a virtual machine running on other computers. Comun is trying to stay more abstract, hardware independent and be more close to math (e.g. by its syntax), it doesn't assume any native integer size or memory size, it doesn't use any English keywords, it aims to be usable natively (as a compiled language) on many different platforms, assuming as little as possible about them -- it is trying to be a "better, simple C". Uxn is more of a "new NES", an idealization and improvement of old computers, it has a hardcoded amount of memory, specified integer size (8 or 16 bit), uses assembly with English mnemonics just like the old computers etc.
Details
{ Start rant: the description of everything by 100rabbits is so fucking hard and painful as fuck to understand -- not because the described technology itself would be complicated but the writing is just really REALLY bad, it's hard to say exactly what it is but he just seems to be trying to write poetry in technical specifications, that's just extremely fucked up. There are tables where meaning of rows and columns is left to be guessed, hyperlinks of important terms lead to shitass long articles about something completely else, he invents 10 different fancy sounding words he uses interchangeably without ever explaining their meaning in a non-cryptic way. It's also fucking infuriating there are some fucking shitty childish drawings randomly inserted into opcode specification along with some random hand gesture signals for the opcodes and what the fuck. It's like he's abusing the specification to force feed you his ugly drawings which he probably thinks look good while also trying to teach you what sounds animals make as if it's fucking kindergarden. Fuck this shit, I now have to read through it and make sense of it so you don't have to. I'll prolly rather read some 3rd party tutorial lol. ~drummyfish }
Here is a kind of concise sum up of uxn "ecosystem"/terminology/specs/etc.:
- uxn (also uxn CPU): The virtual machine, "computing backend", something that runs uxn binary roms.
- so called one page computer (can implement itself in at most 500 lines of own assembly)
- has 2 circular stacks: working stack and return stack, each one has size of 256 bytes.
- memory: total size 64 kb, memory map is following:
- 16 varvara devices, each one taking 16 bytes.
- address 256: start of program instructions.
- instructions: Each one takes 8 bits. Every value is a valid instruction. Instruction format is following:
- lowest 5 bits: instruction opcode (i.e. there are 32 instructions in total)
- following bit (2): if set, instruction works with 16 bit shorts (otherwise it works with 8 bit bytes).
- following bit (k): if set, instruction will not pop any operands.
- following bit (r): if set, instruction operates on the return stack (otherwise it operates on working stack).
- uxntal (also just tal): Assembly language, i.e. human readable language that compiles to a binary rom, with more or less one-to-one mapping between machine code instructions and the language mnemonics. Tal is what uxn program are written in; the tal files have
.tal
extension. A quick sum up of the language follows:- Comments are in parentheses, as
( comment )
. - Mnemonics such as
ADD
,EQU
,POP
etc. are used. - Postfix notation.
- "Runes" are used as directives and syntax sugar, for example
|
says where in memory to store the instruction,@something
creates a jump label etc. - Macros (inlined instructions) are supported.
- Comments are in parentheses, as
- rom: Compiled binary executable that can be directly run by an uxn CPU. The rom files have
.rom
extension. - varvara: A device, "frontend", peripheral that's connected to uxn CPU to perform input/output, for example a screen, keyboard or terminal.
TODO: vectors, subroutines, ...