commit b32c09a2d663c92bd6fb84727445c25aa584f7b5
parent 6cd8c6e587341b2d13b4620c8dcb17582b200a14
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Tue, 4 Jul 2023 13:13:03 -0400
hal arm: add missing S bit in &,
Diffstat:
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/fs/tests/hal.fs b/fs/tests/hal.fs
@@ -327,4 +327,11 @@ code test37 ( a b -- b|8b-a )
PSP) 8b) |, nip, exit,
$1234 $80 test37 $b4 #eq
+
+\ Arithmetic words set flags
+code test38 ( a b -- Z-for-a&b )
+ PSP) &, NZ) C>W, nip, exit,
+
+2 1 test38 0 #eq
+2 3 test38 1 #eq
testend
diff --git a/fs/xcomp/arm/rpi/kernel.fs b/fs/xcomp/arm/rpi/kernel.fs
@@ -920,7 +920,7 @@ xcode -, ( operand -- )
mov) r0 rd) $00500000 imm) ,) ( sub+s ) L1 abs>rel b) ,)
xcode &, ( operand -- )
- mov) r0 rd) $00000000 imm) ,) ( and+s ) L1 abs>rel b) ,)
+ mov) r0 rd) $00100000 imm) ,) ( and+s ) L1 abs>rel b) ,)
xcode |, ( operand -- )
mov) r0 rd) $01900000 imm) ,) ( and+s ) L1 abs>rel b) ,)