Warn about signed 8-bit truncation for add sp, e8 and ld hl, sp + e8

This commit is contained in:
Rangi
2026-09-07 19:28:45 +02:00
committed by Eldred Habert
parent db9509fba0
commit fdd6cece30
5 changed files with 70 additions and 3 deletions
+22
View File
@@ -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