~vdupras/duskos

c11e613e93199ceed412c31491a89d79ee646793 — Virgil Dupras 3 months ago cda0bb6
rpi: add W>A,

Both @ and ! words work now, in all widths.
2 files changed, 11 insertions(+), 0 deletions(-)

M fs/xcomp/arm/rpi/kernel.fs
M fs/xcomp/rpiboot.fs
M fs/xcomp/arm/rpi/kernel.fs => fs/xcomp/arm/rpi/kernel.fs +4 -0
@@ 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

M fs/xcomp/rpiboot.fs => fs/xcomp/rpiboot.fs +7 -0
@@ 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!