Blame | Last modification | View Log | Download
# file opened: relocation_temporary_labels_exp.asm1 0000 ; since v1.19.0 it is possible to use temporary labels also in expressions,2 0000 ; but it was not test-covered for relocation use cases, adding the test (and fix) now3 00004 0000 ; first section is not part of relocation table5 0000 ORG $10006 1000 2:7 10008 1000 21 00 10 ld hl,2_B9 1003 21 09 10 ld hl,2_F10 1006 21 0D 10 ld hl,3_F ; not in relocation table, even with relocatable label11 100912 1009 2:13 100914 1009 ; second section does test relocation15 100916 1009 RELOCATE_START17 100918 1009 ASSERT 2 * relocate_count == relocate_size19 1009 ASSERT 8 == relocate_count20 1009 08 00 dw relocate_count21 100B 10 00 dw relocate_size22 100D23 100D 3: ; usage of this label should trigger relocation24 100D25 100D ORG $200026 2000 ; no relocation cases27 2000 21 09 10 ld hl,2_B28 2003 21 1F 40 ld hl,2_F29 2006 21 0D 10 ld hl,norel 3_B30 2009 21 0F 40 ld hl,norel 3_F31 200C 21 41 22 ld hl,norel 3_B + 0x123432 200F 21 43 52 ld hl,norel 3_F + 0x123433 2012 21 41 22 ld hl,0x1234 + norel 3_B34 2015 21 43 52 ld hl,0x1234 + norel 3_F35 2018 21 02 30 ld hl,3_F - 3_B36 201B C3 0D 10 jp norel 3_B37 201E C3 0F 40 jp norel 3_F38 202139 2021 ORG $300040 3000 ; relocation cases41 3000 21 0D 10 ld hl,3_B42 3003 21 0F 40 ld hl,3_F43 3006 21 41 22 ld hl,3_B + 0x123444 3009 21 43 52 ld hl,3_F + 0x123445 300C 21 41 22 ld hl,0x1234 + 3_B46 300F 21 43 52 ld hl,0x1234 + 3_F47 3012 C3 0D 10 jp 3_B48 3015 C3 0F 40 jp 3_F49 301850 3018 ORG $400051 4000 ; unstable expressionsrelocation_temporary_labels_exp.asm(52): warning[reldiverts]: Expression can't be relocated by simple "+offset" mechanics, value diverts differently.52 4000 21 0D 00 ld hl,low 3_Brelocation_temporary_labels_exp.asm(53): warning[reldiverts]: Expression can't be relocated by simple "+offset" mechanics, value diverts differently.53 4003 21 0F 00 ld hl,low 3_Frelocation_temporary_labels_exp.asm(54): warning[reldiverts]: Expression can't be relocated by simple "+offset" mechanics, value diverts differently.54 4006 21 10 00 ld hl,high 3_Brelocation_temporary_labels_exp.asm(55): warning[reldiverts]: Expression can't be relocated by simple "+offset" mechanics, value diverts differently.55 4009 21 40 00 ld hl,high 3_Frelocation_temporary_labels_exp.asm(56): warning[reldiverts]: Expression can't be relocated by simple "+offset" mechanics, value diverts differently.56 400C 21 20 B0 ld hl,3*3_F - 3_B57 400F58 400F 3: ; usage of this label should trigger relocation59 400F60 400F ; the relocation table must be after all temporary labels, as those don't manage61 400F ; to settle down within 3 passes if there's dynamic-size table ahead, and "forward"62 400F ; labels are referenced63 400F 01 30 04 30 RELOCATE_TABLE ; should emit the 16 addresses of opcode data63 4013 07 30 0A 3063 4017 0D 30 10 3063 401B 13 30 16 3064 401F65 401F RELOCATE_END66 401F67 401F 2:68 401F# file closed: relocation_temporary_labels_exp.asmValue Label------ - -----------------------------------------------------------0x0008 relocate_count0x0010 relocate_size