mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-19 04:07:05 +00:00
Warn about signed 8-bit truncation for add sp, e8 and ld hl, sp + e8
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
section "test", rom0
|
||||
|
||||
opt Wtruncation=1
|
||||
|
||||
; good
|
||||
ld hl, sp + 0
|
||||
ld hl, sp + 127
|
||||
ld hl, sp - 128
|
||||
ld hl, sp + -128
|
||||
add sp, 0
|
||||
add sp, 127
|
||||
add sp, -128
|
||||
|
||||
; bad
|
||||
ld hl, sp + 128
|
||||
ld hl, sp - 129
|
||||
ld hl, sp + 255
|
||||
ld hl, sp - 256
|
||||
add sp, 128
|
||||
add sp, -129
|
||||
add sp, 255
|
||||
add sp, -256
|
||||
Reference in New Issue
Block a user