shithub: rgbds

ref: 2eca43cd2da5a4be21cada359bd5e152f1896453
dir: /test/asm/overflow.asm/

View raw version
SECTION "sec", ROM0

print_x: MACRO
	printv x
	printt "\n"
ENDM

x = 2147483647
x = x + 1
	dl 2147483647+1
	print_x

x = -2147483648
x = x - 1
	dl -2147483648-1
	print_x

x = -2147483648
x = x * -1
	dl -2147483648 * -1
	print_x

x = -2147483648
x = x / -1
	dl -2147483648 / -1
	print_x

x = -2147483648
x = x % -1
	dl -2147483648 % -1
	print_x

x = -1
x = x << 1
	dl -1 << 1
	print_x

x = 4294967295
x = 4294967296

x = `33333333
x = `333333333