Files
rgbds/test/asm/shift.asm
Rangi cee3d1c859 Add more test coverage for RGBASM (#1256)
This also fixes two bugs: `-1 >>> 32` was -1 not 0, and `macro_FreeArgs` should have been called but wasn't.
2023-11-29 15:16:05 -05:00

42 lines
645 B
NASM

macro test
; Test the rpn system, as well as the linker...
DEF expr EQUS STRRPL(STRRPL("\1 + zero)", "<< ", "<< ("), ">> ", ">> (")
dl expr
PURGE expr
; ...as well as the constexpr system
println "\1 = ", (\1)
endm
section "test", ROM0[0]
test 1 << 1
test 1 << 32
test 1 << 9001
test -1 << 1
test -1 << 32
test -1 << -9001
test -1 >> 1
test -1 >> 32
test -1 >> 9001
test -4 >> 1
test -4 >> 2
test -1 >> -9001
test 100 << -2
test 1 >> -2
test 100 >>> 16
test 100 >>> -16
test 100 >>> 32
test 100 >>> -32
test -100 >>> 32
test -100 >>> -32
test $DEADBEEF >> 1
test $DEADBEEF >>> 1
SECTION "Zero", ROM0[0]
zero: