Skip to content

Ismael-VC/starting-uxn-uf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starting UXN Tal and UF Forth.

This repository contains example code and excercises from the book "Starting Forth", implemented in Uxntal (.tal) and in Uf Forth (.f), separated by chapter.

UXN

Installation

$ git clone https://git.sr.ht/\~rabbits/uxn
$ cd uxn
$ mkdir ~/bin
$ sudo apt install libsdl2-dev wget  # Ubuntu
$ pkg install sdl2 wget              # Android Termux
$ ./build.sh --install               # copies executables to ~/bin
$ cp boot.rom ~/roms
$ export PATH=~/bin:$PATH
$ cd ~/.config/micro
$ mkdir syntax && cd syntax
$ # Setup UXN Tal syntax highlighting for the micro editor.
$ wget https://hacklab.nilfm.cc/dotfiles/raw/main/micro/syntax/uxn.yaml

Updating

$ cd uxn
$ git pull
$ ./build.sh --install
$ cp boot.rom ~/roms

Configuration

# ~/.zshrc
alias asm="~/bin/uxnasm"            # assembler
alias cli="~/bin/uxncli"            # command line interface
alias emu="~/bin/uxnemu"            # graphical emulator
alias uxn="uxnemu ~/roms/boot.rom"  # Varvara's Potato OS

export PATH=~/bin:$PATH

Workflow

$ micro file-name.tal
$ uxnasm file-name.tal fil-name.rom && uxncli file-name.rom
$ uxncli rom-name.rom &> file-name.txt

UF

Installation

$ git clone https://gitlab.com/b2495/uf
$ cd uf
$ uxnasm kernel.tal kernel.rom
$ uxncli kernel.rom <uf.f
$ cp ufx.rom uf.rom uf0.rom ~/roms
$ sudo apt install rlwrap                 # CLI REPL readline editing support

Updating

$ cd uf
$ git pull
$ uxnasm kernel.tal kernel.rom
$ uxncli kernel.rom <uf.f
$ cp ufx.rom uf.rom uf0.rom ~/roms

Configuration

# ~/.zshrc
alias ufx="uxnemu -2x ~/roms/ufx.rom"     # core + uxn + graphical
alias uf="rlwrap uxncli ~/roms/uf.rom"    # core + uxn
alias ufo="rlwrap uxncli ~/roms/uf0.rom"  # core

Updating configuration

$ micro ~/zshrc    # do edits
$ source ~/.zshrc  # reload configs

Workflow

$ micro file-name.fth  # edit code
$ uf < file-name.fth   # give uf a file to read as code (exits when finished though!)
$ uf                   # repl + copy paste code

Releases

No releases published

Packages

No packages published