From 23d293fb484f57f242c473c0b51690cf68d3b214 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 10 Jun 2024 08:51:00 -0800 Subject: [PATCH] (uxndis) Print labels in immediate jumps --- cli/uxndis/src/uxndis.tal | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/cli/uxndis/src/uxndis.tal b/cli/uxndis/src/uxndis.tal index a2b9a29..7fdfa0f 100644 --- a/cli/uxndis/src/uxndis.tal +++ b/cli/uxndis/src/uxndis.tal @@ -26,8 +26,7 @@ &>l ( -- ) INC2 GTH2k ?&>l - POP2 POP2 #010e DEO - #800f DEO + POP2 POP2 #800f DEO BRK } .Console/read DEI src/ BRK @@ -52,6 +51,7 @@ .File/name DEO2 #4000 .File/length DEO2 ;sym .File/read DEO2 + .File/success DEI2 #0000 EQU2 ;find-sym/null STA JMP2r @ ( addr* -- addr* ) @@ -99,8 +99,8 @@ LDAk #03 SFT #00 SWP ;opcodes/brk ADD2 #2018 DEO - INC2 LDA2k - INC2 JMP2r } + DUP2 INC2k LDA2 + INC2 INC2 JMP2r } LDAk DUP #80 NEQ SWP #c0 NEQ AND ?{ ;opcodes @@ -125,11 +125,19 @@ [ LIT2 "r 18 ] DEO } JMP2r -@ ( value* -- ) +@ ( addr* value* -- ) + ( | find sym ) + SWP2 ;rom SUB2 #0103 ADD2 OVR2 ADD2 find-sym + ( ) DUP2 #ffff NEQ2 ? + POP2 + ( | resume ) OVR #80 AND ? [ LIT2 "+ 18 ] DEO ! +@ ( addr* sym* -- ) + NIP2 ! + @ ( count -- ) #00 &>l ( -- ) @@ -139,11 +147,12 @@ @find-sym ( addr* -- sym* ) ,&t STR2 + [ LIT &null 01 ] ?&skip ;sym &>w ( -- ) LDA2k [ LIT2 &t $2 ] NEQ2 ?{ INC2 INC2 JMP2r } INC2 INC2 scap/ INC2 INC2k INC2 LDA ?&>w - POP2 #ffff JMP2r + POP2 &skip #ffff JMP2r ( @|stdlib )