commit bed4614270f55107c81bf35b86551338dadb4793
parent b27dfebfc440db8d6aeb9cfda1f096727caee1cd
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Mon, 3 Jul 2023 13:44:59 -0400
hal arm: make /mod, work with <>)
up to test32 in tests/hal
Diffstat:
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/fs/xcomp/arm/rpi/kernel.fs b/fs/xcomp/arm/rpi/kernel.fs
@@ -25,6 +25,7 @@
: pushret, rLR push, ;
: popret, rLR pop, ;
: ret, rLR bx) ,) ;
+: absb, abs>rel b) ,) ;
: absbl, abs>rel bl) ,) ;
: abscall, pushret, absbl, popret, ;
: wcall, xwordlbl abscall, ;
@@ -1071,8 +1072,9 @@ pc
mov) rTOP rd) r1 rm) ,) \ set quotient
ret,
+\ Write /mod with HALINV already processed
pc L1 le,
-xcode /mod, ( operand -- )
+pc to L2 ( operand -- )
wcall, A>)
wcall, @,
wcall, pushret,
@@ -1081,6 +1083,18 @@ xcode /mod, ( operand -- )
wcall, branchR,
wjmp, popret,
+\ Write /mod with <>)
+pc to L3 ( operand -- )
+ bic) rTOP rdn) HALINV imm) ,)
+ xdup, xdup, wcall, @!,
+ L2 abscall,
+ wjmp, @!,
+
+xcode /mod, ( operand -- )
+ tst) rTOP rn) HALINV imm) ,)
+ L3 abs>rel b) nz) ,)
+ L2 absb,
+
\ Speed-critical words
xcode move ( src dst u -- )
r2 ppop, r0 ppop, \ r0=src r2=dst