From 7f35e1863af6f147a691f128012705d6fb9b19b0 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 16 Jul 2023 09:41:40 -0700 Subject: [PATCH] Improved device examples --- projects/examples/devices/console.write.tal | 16 ++++++++++++++++ projects/examples/devices/system.catch.tal | 2 ++ projects/examples/devices/system.expansion.tal | 7 ++++--- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 projects/examples/devices/console.write.tal diff --git a/projects/examples/devices/console.write.tal b/projects/examples/devices/console.write.tal new file mode 100644 index 0000000..42d6366 --- /dev/null +++ b/projects/examples/devices/console.write.tal @@ -0,0 +1,16 @@ +( usage: uxncli console.write.rom ) + +|10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1 + +|0100 + +@on-reset ( -> ) + ;text + &while ( -- ) + LDAk .Console/write DEO + INC2 LDAk ?&while + POP2 BRK + +@text + "Hello $1 + diff --git a/projects/examples/devices/system.catch.tal b/projects/examples/devices/system.catch.tal index 0e7ee97..3efc56b 100644 --- a/projects/examples/devices/system.catch.tal +++ b/projects/examples/devices/system.catch.tal @@ -1,3 +1,5 @@ +( usage: uxncli system.catch.rom ) + |00 @System &catch $2 &expansion $2 &pad $2 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &halt $1 |10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1 diff --git a/projects/examples/devices/system.expansion.tal b/projects/examples/devices/system.expansion.tal index 2a687e6..2cafa83 100644 --- a/projects/examples/devices/system.expansion.tal +++ b/projects/examples/devices/system.expansion.tal @@ -1,3 +1,4 @@ +( usage: uxncli system.expansion.rom ) |00 @System &catch $2 &expansion $2 &pad $2 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &halt $1 |10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1 @@ -10,12 +11,12 @@ BRK @cmd - [ 01 000b 0000 =src 0000 =dst ] + [ 01 000c 0000 =src 0000 =dst ] @src - "Hello 20 "World $80 + "Hello 20 "World $1 -@dst $0c +@dst $c @ ( str* -- ) &w ( -- )