Skip to content

Instantly share code, notes, and snippets.

@Ismael-VC
Created March 12, 2024 15:19
Show Gist options
  • Save Ismael-VC/fdb0a5fc5bef0e5e36e904ab74353222 to your computer and use it in GitHub Desktop.
Save Ismael-VC/fdb0a5fc5bef0e5e36e904ab74353222 to your computer and use it in GitHub Desktop.
( usage: uxncli terminal-cli.rom )
|10 @Console &vector $2 &read $1 $5 &write $1
|0a @enter
|100
@on-reset ( -> )
;on-console .Console/vector DEO2
;prompt INC <print-str>
BRK
@on-console ( -> )
.Console/read DEI
DUP .enter NEQ ?{
;prompt <print-str>
POP BRK }
<emit>
BRK
@<emit> ( char -- ) .Console/write DEO JMP2r
@<print-str> ( str* -- )
&while ( -- )
LDAk <emit>
INC2 LDAk ?&while
POP2 JMP2r
@you-said 0a "echo> 20 $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment