Add unsigned right shift operator

This commit is contained in:
ISSOtm
2022-02-05 11:27:41 +01:00
committed by Eldred Habert
parent cf19879281
commit eb5af70d79
13 changed files with 60 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
macro test
; Test the rpn system, as well as the linker...
DEF expr EQUS STRRPL(STRRPL("\1 + zero)", "<<", "<< ("), ">>", ">> (")
DEF expr EQUS STRRPL(STRRPL("\1 + zero)", "<< ", "<< ("), ">> ", ">> (")
dl expr
PURGE expr
@@ -24,5 +24,8 @@ section "test", ROM0[0]
test -4 >> 2
test -1 >> -9001
test $DEADBEEF >> 1
test $DEADBEEF >>> 1
SECTION "Zero", ROM0[0]
zero:

View File

@@ -24,3 +24,5 @@ warning: shift.asm(25) -> shift.asm::test(8): [-Wshift]
Shifting right negative value -1
warning: shift.asm(25) -> shift.asm::test(8): [-Wshift-amount]
Shifting right by negative amount -9001
warning: shift.asm(27) -> shift.asm::test(8): [-Wshift]
Shifting right negative value -559038737

View File

@@ -10,3 +10,5 @@
-4 >> 1 = $FFFFFFFE
-4 >> 2 = $FFFFFFFF
-1 >> -9001 = $0
$DEADBEEF >> 1 = $EF56DF77
$DEADBEEF >>> 1 = $6F56DF77

Binary file not shown.