commit c11e613e93199ceed412c31491a89d79ee646793
parent cda0bb63b083223e324df473463d27bf17929d73
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Wed, 31 May 2023 18:09:46 -0400
rpi: add W>A,
Both @ and ! words work now, in all widths.
Diffstat:
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/fs/xcomp/arm/rpi/kernel.fs b/fs/xcomp/arm/rpi/kernel.fs
@@ -456,6 +456,10 @@ pc mov) rTOP rd) 0 i) ,)
xcode LIT>W, ( n -- )
( pc ) r0 pc@>reg, L1 abs>rel b) ,)
+pc mov) rA rd) rTOP rm) ,)
+xcode W>A, ( -- )
+ ( pc ) r0 pc@>reg, lbldwrite abs>rel b) ,)
+
\ operand is 16b
pc mov) r0 rd) 0 i) ,)
pc to L2 ( operand -- ) \ r0=base instr r1=off
diff --git a/fs/xcomp/rpiboot.fs b/fs/xcomp/rpiboot.fs
@@ -16,5 +16,12 @@ code16b HERE @ W) 16b) @, exit,
code8b HERE @ W) 8b) @, exit,
code c@ branch, drop
code w@ branch, drop
+
+code ! W>A, PSP) @, A) !, 2drop, exit,
+code16b HERE @ W>A, PSP) @, A) 16b) !, 2drop, exit,
+code8b HERE @ W>A, PSP) @, A) 8b) !, 2drop, exit,
+code c! branch, drop
+code w! branch, drop
+
uartinit prompt interactive!