From f51f32c17e5b82c1acb86f00c206179de7ae502f Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Fri, 21 Apr 2023 11:21:02 -0700 Subject: [PATCH] Standard loadout --- build.sh | 2 ++ src/uxnrea.tal | 74 +++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 66 insertions(+), 10 deletions(-) diff --git a/build.sh b/build.sh index bb1e974..647c506 100755 --- a/build.sh +++ b/build.sh @@ -17,6 +17,8 @@ case "$*" in *--lint*) $lin $src ;; esac $asm $src $dst case "$*" in *--save*) cp $dst $roms_dir ;; esac +# uxnemu "${roms_dir}/left.rom" etc/hello.tal | uxncli "${roms_dir}/drifblim.rom" bin/hello.rom + # hello.tal -> hello.rom -> hello.tal $asm etc/hello.tal bin/hello.rom $emu $dst bin/hello.rom bin/hello.dis.tal # > etc/hello-dis.tal diff --git a/src/uxnrea.tal b/src/uxnrea.tal index aaa4ddd..d4e2338 100644 --- a/src/uxnrea.tal +++ b/src/uxnrea.tal @@ -20,24 +20,78 @@ @nested $1 @last $1 -|0100 ( -> ) +|0100 - .Console/type DEI ?&has-args ;dict/usage pstr &has-args - ;&await .Console/vector DEO2 BRK - &await ( -> ) .Console/read DEI .src skey ?ready-dst BRK - @ready-dst ( -> ) ;&await .Console/vector DEO2 BRK - &await ( -> ) .Console/read DEI .dst skey ?on-ready BRK +@on-reset ( -> ) -@on-ready ( -> ) + .Console/type DEI ?&has-args + ;dict/usage pstr &has-args + ;&await-src .Console/vector DEO2 + +BRK + +&await-src ( -> ) + + .Console/read DEI + DUP LIT "^ EQU ?on-interactive + .src skey ?on-default + +BRK + +( +@|modes ) + +@on-default ( -> ) + + ;&await-dst .Console/vector DEO2 + +BRK &await-dst ( -> ) .Console/read DEI .dst skey ?&eval-once BRK + +&eval-once ( -> ) + + reassemble print-summary + ( debug ) #010e DEO + ( halt ) #800f DEO + +BRK + +@on-interactive ( c -> ) + + ;&await-dst .Console/vector DEO2 + +BRK &await-dst ( -> ) .Console/read DEI .dst skey ?&capture-src BRK + +&capture-src ( -> ) + + ;&await-src .Console/vector DEO2 + +BRK &await-src ( -> ) .Console/read DEI .src skey ?&eval-loop BRK + +&eval-loop ( -> ) + + reassemble print-summary + ;src sclr + +BRK + +( +@|main ) + +@reassemble ( -- ) load-symbols stream #0a emit #0a emit - ( debug ) #010e DEO - ( halt ) #800f DEO -BRK + +JMP2r + +@print-summary ( -- ) + + + +JMP2r ( @|core ) -- 2.45.2