commit 66d0b20f7319caafef49af440866cb5b8bdeb0de
parent 838967f90e863f5dc5d64da8a0f108cd8f234829
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Wed, 24 May 2023 12:28:17 -0400
rpi: add "stype" routine
Diffstat:
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/fs/xcomp/arm/rpi/kernel.fs b/fs/xcomp/arm/rpi/kernel.fs
@@ -16,18 +16,19 @@ $38 const UART0_IMSC
$44 const UART0_ICR
$10000 const CURWORD
+$11000 const DICTIONARY
: delay, ( ncycles -- )
mov) r0 rd) swap ( ncycles ) i) ,)
pc sub) r0 rd) r0 rn) 1 i) f) ,) ( pc ) abs>rel b) ne) ,) ;
: values ( n -- ) for 0 value next ;
-5 values lblemit lblkey lblrtype lblword lblmsg
+6 values lblemit lblkey lblrtype lblword lblstype lblmsg
$8000 to binstart
0 align4 here to org
forward b) ,)
-pc to lblmsg ," Hello World!" 0 align4
+pc to lblmsg 12 c, ," Hello World!" 0 align4
pc to lblemit \ r0=char
ldr) r3 rd) r7 rn) UART0_FR +i) ,)
tst) r3 rn) $20 i) ,)
@@ -46,7 +47,11 @@ pc to lblrtype \ r1=addr r2=len
sub) r2 rd) r2 rn) 1 i) f) ,)
lblrtype abs>rel b) ne) ,)
lret,
-pc to lblword \ r2=len, word in CURWORD
+pc to lblstype \ r1=str
+ ldr) r2 rd) r1 rn) 8b) 1 +i) post) ,)
+ lblrtype abs>rel b) ,)
+
+pc to lblword \ str in CURWORD
pc
lblkey abscall,
cmp) r0 rn) SPC i) ,)
@@ -55,10 +60,12 @@ pc to lblword \ r2=len, word in CURWORD
mov) r1 rd) CURWORD i) ,)
pc
add) r2 rd) r2 rn) 1 i) ,)
- str) r0 rd) r1 rn) 8b) 1 +i) post) ,)
+ str) r0 rd) r1 rn) 8b) 1 +i) pre) !) ,)
lblkey abscall,
cmp) r0 rn) SPC i) ,)
( pc ) abs>rel b) hi) ,)
+ mov) r1 rd) CURWORD i) ,)
+ str) r2 rd) r1 rn) 8b) ,)
lret,
forward!
@@ -100,11 +107,10 @@ str) r1 rd) r7 rn) UART0_CR +i) ,)
mov) r1 rd) binstart i) ,)
add) r1 rd) r1 rn) lblmsg binstart - i) ,)
-mov) r2 rd) 12 i) ,)
-lblrtype abs>rel bl) ,)
+lblstype abs>rel bl) ,)
pc
lblword abs>rel bl) ,)
mov) r1 rd) CURWORD i) ,)
- lblrtype abs>rel bl) ,)
+ lblstype abs>rel bl) ,)
abs>rel b) ,)