~vdupras/duskos

bb31039a48cf66fe9fac3f12ae9f454e0bb9d31e — Virgil Dupras 3 months ago c11e613
rpi: add +,

This makes +! work.
2 files changed, 13 insertions(+), 2 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 +9 -2
@@ 482,11 482,11 @@ pc to L3 ( operand -- ) \ r0=base instr
  orr) nz) rTOP rdn) r1 rm) ,)
  L1 abs>rel b) ,)

pc ldr) rTOP rd) 0 +i) ,)
pc ldr) 0 +i) ,)
xcode @, ( operand -- )
  ( pc ) r0 pc@>reg, L3 abs>rel b) ,)

pc str) rTOP rd) 0 +i) ,)
pc str) 0 +i) ,)
xcode !, ( operand -- )
  ( pc ) r0 pc@>reg, L3 abs>rel b) ,)



@@ 502,6 502,13 @@ xcode @!, pushret, ( operand -- )
  bic) rTOP rdn) $04000000 i) ,) \ remove 32b flag
  popret, L1 abs>rel b) ,)

pc add) rTOP rdn) r0 rm) ,)
xcode +, ( operand -- )
  bic) rTOP rdn) $f000 i) ,) \ Rd=r0
  pushret, wcall, @, popret,
  ( pc ) r0 pc@>reg,
  lbldwrite abs>rel b) ,)

pc pushret,
xcode pushret,
  ( pc ) r0 pc@>reg, lbldwrite abs>rel b) ,)

M fs/xcomp/rpiboot.fs => fs/xcomp/rpiboot.fs +4 -0
@@ 23,5 23,9 @@ code8b HERE @ W>A, PSP) @, A) 8b) !, 2drop, exit,
code c! branch, drop
code w! branch, drop

code +! W>A, drop, A) +, A) !, drop, exit,
code16b W>A, drop, A) 16b) +, A) 16b) !, drop, exit,
code8b W>A, drop, A) 8b) +, A) 8b) !, drop, exit,

uartinit prompt interactive!