M fs/xcomp/arm/rpi/kernel.fs => fs/xcomp/arm/rpi/kernel.fs +8 -2
@@ 416,6 416,7 @@ xcode 32b) ( operand -- operand )
\ HAL operations
\ r0 is used as the immediate accumulator
\ TODO: add support for immediate > 0xff
+\ TODO: add out-of-range error for offsets not fitting 12 bits
pc to L1 ( operand -- ) \ r0=base instr
orr) r0 rdn) rTOP rm) ,)
@@ 441,9 442,14 @@ pc mov) rTOP rd) 0 i) ,)
xcode LIT>W, ( n -- )
( pc ) r0 pc@>reg, L1 abs>rel b) ,)
-pc ldr) rTOP rd) ,)
+pc to L2 ( operand -- ) \ r0=base instr
+ lblhbank r1 pc@>reg,
+ orr) rTOP rdn) r1 rm) ,)
+ L1 abs>rel b) ,)
+
+pc ldr) rTOP rd) 0 +i) ,)
xcode @, ( operand -- )
- ( pc ) r0 pc@>reg, L1 abs>rel b) ,)
+ ( pc ) r0 pc@>reg, L2 abs>rel b) ,)
pc pushret,
xcode pushret,
M fs/xcomp/rpiboot.fs => fs/xcomp/rpiboot.fs +3 -1
@@ 1,6 1,8 @@
code : pushret, ] code pushret, ] ;
code noop exit,
code dup dup, exit,
-: hey 42 ;
+: nip, 4 ps+, ; code nip nip, exit,
+: drop, PSP) @, nip, ; code drop drop, exit,
+: 2drop, PSP) 4 +) @, 8 ps+, ; code 2drop 2drop, exit,
uartinit prompt interactive!