« Oatmeal

uxn laboratory

As I look to assembly nights 2 and think of trying my own take on it, I wanna have a cozy space ready to play with uxn.

The setup I’ve landed on is sort of inspired by plan9port.

Prepare the way

  • in home directory, create a u directory
  • in u clone uxn and build it
  • add ~/u/uxn/ to your path as $UXN
  • add $UXN/bin to your path
  • moving forward we’ll put any and all *.rom files into $UXN/bin

Utility scripts

  • create script called u that contains the following

export UXN

case "$PATH" in
    export PATH

case $# in
       exec "$@"
  • make u executable with chmod +x and mv it to /usr/local/bin or some similar space

  • in $UXN/bin add the following scripts, make each executable with chmod +x

  • lin, used to lint *.tal files before assembly.

# script name: lin

u uxncli uxnlin.rom $1
  • asm, used to assemble *.tal files into executable *.roms.
# script name: asm

u uxnasm $1 $2
  • run, used to run *.roms in the sdl2 uxn emulator.
# script name: run

u uxnemu $1
  • cli, used to run command line *.roms into stdin/stdout at the shell prompt.
# script name: cli

u uxncli $1
# script name: drif

u uxncli drifblim.rom $1 $2

rom library

  • wget the following roms into $UXN/bin
wget https://rabbits.srht.site/left/left.rom
wget https://rabbits.srht.site/drifblim/drifblim.rom

rock and roll

At this point everything is set and cozy to start exploring!

Do that like so:

  • to lint a *.tal file,
u lin rad.tal
  • to assemble a *.tal file using an assembler that supports macros,
u asm rad.tal rad.rom
  • to assemble a *.tal file using the selfhosted assembler,
u drif rad.tal rad.rom
  • to run a rom in the emulator
u run rad.rom
  • to run a rom at the prompt
u cli rad.rom
  • to edit something using left,
u uxnemu left.rom -s 2 rad.tal

NOTE: the -s 2 bit makes the program run zoomed…I’ve got bad eyesight and have a high DPI screen, you may not need that flag.


Now, I’ll be honest — I don’t know if I’ll actually do my own flavor of assembly nights with uxn, but I’m really pleased with this little setup…so, that is a step in the right direction. The other step in the right direction I’ve taken is that I started to read Programming from the Ground Up by Jonathan Bartlett…so far, 2 chapters in, I am enjoying it a lot.