~vdupras/duskos

aec9e29a39d7285a89446a4000414b6e7912fad3 — Virgil Dupras 3 months ago c3db936
rpi: add [@],

This brings us to @@+ in bootlo, which can be verified with stuff like:
$12345678 HERE @ ! HERE @@+

and again with w@@+ and c@@+ variants.
2 files changed, 13 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 +7 -0
@@ 544,6 544,13 @@ xcode [+n], ( n operand -- )
  lblimmwr abs>rel bl) ,)
  popret, wjmp, !,

xcode [@], ( operand -- )
  pushret, xdup, ( operand operand )
  bic) rTOP rdn) $f000 i) ,) \ Rd=r0
  wcall, 32b) wcall, @, ( operand )
  bic) rTOP rdn) $f0000 i) ,) \ Rn=r0
  popret, wjmp, @,

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

M fs/xcomp/rpiboot.fs => fs/xcomp/rpiboot.fs +6 -0
@@ 45,5 45,11 @@ code16b W>A, drop, A) 16b) !, W<>A, 2 W+n, exit,
code8b HERE @ W>A, drop, A) 8b) !, W<>A, 1 W+n, exit,
code c!+ branch, drop

code @@+ W>A, A) [@], 4 A) [+n], exit,
code16b HERE @ W>A, A) 16b) [@], 2 A) [+n], exit,
code8b HERE @ W>A, A) 8b) [@], 1 A) [+n], exit,
code c@@+ branch, drop
code w@@+ branch, drop

uartinit prompt interactive!