From da6e55e121fd40987332db9c5ca2a591674a587c Mon Sep 17 00:00:00 2001 From: neauoire Date: Sat, 25 Nov 2023 15:34:59 -0800 Subject: [PATCH] (icnuf1) Init --- cli/icnuf1/816.icn | Bin 0 -> 2048 bytes cli/icnuf1/build.sh | 25 +++++++++++++ cli/icnuf1/icnuf1.tal | 82 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 cli/icnuf1/816.icn create mode 100755 cli/icnuf1/build.sh create mode 100644 cli/icnuf1/icnuf1.tal diff --git a/cli/icnuf1/816.icn b/cli/icnuf1/816.icn new file mode 100644 index 0000000000000000000000000000000000000000..0417868b3ead15919bb29d78e57e54c30aa08af5 GIT binary patch literal 2048 zcmeHHziSjx5FQ@Ov4zMQQXE0zaxAiiNC*~dJdWk@I9_29LJA9uaEMr>2v!G%xI7LG zAz)YzkyLU;iu?sZEW#1)53oq1ML;l(gey~oi{H%dp87vzik+MH=GXVlydx?l5ee4U zqsa2n%*@Q&D2jq)HUGG`oTyH}-~aR~papB~a`^D>;h(^ZybM<C#eL191kM4>V1*POa@u_1t|8`aaM(-)`Za+drw zw@u-K`LWg*{gWt7i?|%;oIl^$*?BjV_<}FNs}1^*hNk!*J?&-LTAe0&F1Q3Ico=aa z@WeU?jtgVrIEZ0`y*Q>xZ<{AG&p{9Xk%^DR!Y4LPcA@-qnH|CN#hApep>65gL;91W z64z#llX>E57#+yuX%P>NaY=gkg`w6CJe1|;i|MP%My3DcdSLwUo1a5MSjj# zN=rNU?oELc+XvdP0KnUWm=@8bv@4t@NxMDgHZfh9zZAJ9;^pHFc=iIDg!xzJ7*(Es z|GO`sclus<=F#QA%%AvWFsGa6onq1Yo`_+j>9^ZZ#ZOf33b7jaw0uSwwm&##bU zqyf|ZT7FAhs}H(2*nu&_Yh@x5i fA?$rlv3m`ECzv}+t*Vb#&vIPVz0o%eFav)88Nonr literal 0 HcmV?d00001 diff --git a/cli/icnuf1/build.sh b/cli/icnuf1/build.sh new file mode 100755 index 0000000..31a7851 --- /dev/null +++ b/cli/icnuf1/build.sh @@ -0,0 +1,25 @@ +#!/bin/sh -e + +ID="icnuf1" +ASM="uxncli $HOME/roms/drifblim.rom" +EMU="uxncli" +LIN="uxncli $HOME/roms/uxnlin.rom" +SRC="${ID}.tal" +DST="${ID}.rom" +CPY="$HOME/roms" +ARG="816.icn" + +if [[ "$*" == *"--lint"* ]] +then + $LIN $SRC +fi + +$ASM $SRC $DST + +if [[ "$*" == *"--save"* ]] +then + cp $DST $CPY +fi + +$EMU $DST $ARG + diff --git a/cli/icnuf1/icnuf1.tal b/cli/icnuf1/icnuf1.tal new file mode 100644 index 0000000..9691184 --- /dev/null +++ b/cli/icnuf1/icnuf1.tal @@ -0,0 +1,82 @@ +( uxncli format-c.rom file.bin ) + +|10 @Console &vector $2 &read $1 &pad $5 &write $1 &error $1 +|a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 + +|0000 + + @src $40 + +|0100 + +@on-reset ( -> ) + ;on-console .Console/vector DEO2 + BRK + +@on-console ( -> ) + [ LIT2r =src ] + ( read input ) .Console/read DEI DUP #20 LTH OVR #7f GTH ORA ?&>end + STH2kr slen #003f GTH2 ?&>end + STH2kr scap STA + POP2r BRK &>end + POP + ( | read ) + STH2r .File/name DEO2 + #0800 .File/length DEO2 + ;icn .File/read DEO2 + ( | convert ) + + #800f DEO + BRK + +@ ( a b -- ) + OVR phex/b #2018 DEO + DUP phex/b #0a18 DEO + POP2 +JMP2r + +@ ( -- ) + #0000 + &l ( -- ) + ( | print pos ) + ( y ) DUP #15 SFT OVR #01 AND ADD #40 SFT STH + ( x ) DUP #01 SFT #0f AND + ( merge ) STHr ORA + OVR + INC DUP ?&l + POP2 +JMP2r + +@blank [ ffff ffff ffff ffff ] + +( +@|stdlib ) + +@slen ( str* -- len* ) + DUP2 scap SWP2 SUB2 JMP2r + +@scap ( str* -- end* ) + LDAk #00 NEQ [ JMP JMP2r ] + &w ( -- ) + INC2 LDAk ?&w + JMP2r + +@phex ( short* -- ) + SWP phex/b + &b ( -- ) + DUP #04 SFT phex/c + &c ( -- ) + #0f AND DUP #09 GTH #27 MUL ADD #30 ADD #18 DEO + JMP2r + +@pstr ( str* -- ) + &while ( -- ) + LDAk #18 DEO + INC2 LDAk ?&while + POP2 JMP2r + +@icn $800 + +@uf1 $800 + +