~vdupras/duskos

10c981c71d6a7d03efe344b31ec685b2f4bf3857 — Virgil Dupras 3 months ago aec9e29
rpi: add [!],

This brings us up to :16b in bootlo. Speeding up!

@!+ can be verified with stuff like "$12345678 HERE @!+ -4 HERE +! HERE @@+"
2 files changed, 33 insertions(+), 9 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 +12 -5
@@ 544,12 544,19 @@ 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 )
pc to L1 ( operand -- operand-rn=r0 )
  xdup, bic) rTOP rdn) $f000 i) ,) \ Rd=r0
  pushret, wcall, 32b) wcall, @, popret,
  bic) rTOP rdn) $f0000 i) ,) \ Rn=r0
  popret, wjmp, @,
  exit,

xcode [@], ( operand -- )
  pushret, L1 abs>rel bl) ,) popret,
  wjmp, @,

xcode [!], ( operand -- )
  pushret, L1 abs>rel bl) ,) popret,
  wjmp, !,

pc pushret,
xcode pushret,

M fs/xcomp/rpiboot.fs => fs/xcomp/rpiboot.fs +21 -4
@@ 46,10 46,27 @@ 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
code16b W>A, A) 16b) [@], 2 A) [+n], exit,
code8b W>A, A) 8b) [@], 1 A) [+n], exit,
code @!+ W>A, drop, A) [!], 4 A) [+n], drop, exit,
code16b W>A, drop, A) 16b) [!], 2 A) [+n], drop, exit,
code8b W>A, drop, A) 8b) [!], 1 A) [+n], drop, exit,

code + PSP) +, nip, exit,
code - -W, PSP) +, nip, exit,
: -^ swap - ;
: e>w 4 + ;
: e>wlen 5 - ;
: w>e 4 - ;
: current sysdict @ e>w ;
code 1+ 1 W+n, exit,
code 1- -1 W+n, exit,
: immediate sysdict @ e>wlen dup c@ $80 or swap c! ;
: EMETA_16B $11 ; : EMETA_8B $10 ;
: 16b EMETA_16B MOD ! ; immediate
: 8b EMETA_8B MOD ! ; immediate
: :8b code8b ] ;
: :16b code16b ] ;

uartinit prompt interactive!