commit 552fbf12c22369ce97bae08fd67f6889071d6317
parent e2605403a50c63f77b37966679e3b198c15df7dd
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Tue, 27 Jun 2023 17:26:43 -0400
asm/armh: add +) and +,
Diffstat:
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/fs/asm/armh.fs b/fs/asm/armh.fs
@@ -1,16 +1,22 @@
\ High HAL for arm
\ W=r9 A=r11 PSP=r10 RSP=13
?f<< /asm/arm.fs
+?f<< /asm/nbank.fs
+:realias bankid@ 7 and ;
+:realias oldbank! HBANK ! ;
: A>) ( halop -- halop ) $ffff0fff and rA 12 lshift or ;
: <>) ( halop -- halop ) $00800000 xor ;
: &) ( halop -- halop ) $01000000 xor ;
+: +) ( halop n -- halop ) bank! $08 or or ;
-: ldrr0, ( halop -- ) 16 rshift $f and ldr) r0 rd) swap rn) ,) ;
+: ?disp) ( instr halop -- instr ) dup $08 and if bank@ +i) else drop then ;
+: ldrr0, ( halop -- )
+ ldr) r0 rd) over 16 rshift $f and rn) swap ?disp) ,) ;
: haldst ( halop -- dst ) 12 rshift $f and ;
: op doer , does> @ ( halop instr )
over ldrr0, swap haldst rdn) r0 rm) f) ,) ;
-sub) op -,
+add) op +, sub) op -,
: *, dup ldrr0, haldst mul) over rd) swap rs) r0 rm) ,) ;
diff --git a/fs/asm/i386.fs b/fs/asm/i386.fs
@@ -27,6 +27,7 @@
: mod@ 6 rshift 3 and ;
: modrm@ $c7 and ;
:realias bankid@ 20 rshift $f and ;
+: newbankedop ( n -- opmod ) bank! 20 lshift ;
: sib@ 24 rshift ;
: imm? $8000 and bool ;
: 8b? bi $100 and not | $ff00 and $8300 = or ;
diff --git a/fs/asm/nbank.fs b/fs/asm/nbank.fs
@@ -5,7 +5,7 @@
\ ability", so we have a rolling bank of 16 numbers down below.
create _bank $10 CELLSZ * allot
0 value _bankidx
-: newbankid to1+ _bankidx _bankidx $f and ;
+: newbankid ( n -- id ) to1+ _bankidx _bankidx $f and ;
: bank' ( id -- a ) CELLSZ * _bank + ;
\ This needs to be realiased by the unit using the bank
alias abort bankid@ ( opmod -- id )
@@ -14,4 +14,4 @@ alias abort bankid@ ( opmod -- id )
\ number bank (single) at the same time as the High HAL number bank. This word
\ is realiased in High HAL units.
alias drop oldbank! ( n -- )
-: newbankedop ( n -- opmod ) dup oldbank! newbankid tuck bank' ! 20 lshift ;
+: bank! ( n -- id ) dup oldbank! newbankid tuck bank' ! ;