Blame | Last modification | View Log | Download
# file opened: relocation_struct.asm1 0000 ORG $10002 1000 RELOCATE_START3 1000 ASSERT 2 * relocate_count == relocate_size4 1000 ASSERT 17 == relocate_count5 1000 11 00 dw relocate_count6 1002 22 00 dw relocate_size7 10048 1004 STRUCT st19 1004 ~ x BYTE $1210 1004 ~ y WORD absolute111 1004 ~ relInit WORD reloc1 ; the default init value should be relocated12 1004 ~ noRel WORD reloc2-reloc1relocation_struct.asm(13): warning[reldiverts]: Expression can't be relocated by simple "+offset" mechanics, value diverts differently.13 1004 ~ badRel WORD 2*reloc1 ; warning about not simple "+offset"14 1004 ~ badRel2 WORD 2*reloc1 ; reldiverts-ok ; suppressed warningrelocation_struct.asm(15): warning[relunstable]: Relocation makes one of the expressions unstable, resulting machine code is not relocatable15 1004 ~ warn1 BYTE high reloc1 ; warning because unstablerelocation_struct.asm(16): warning[relunstable]: Relocation makes one of the expressions unstable, resulting machine code is not relocatable16 1004 ~ warn2 D24 reloc1 ; warning - D24 is not supported for relocationrelocation_struct.asm(17): warning[relunstable]: Relocation makes one of the expressions unstable, resulting machine code is not relocatable17 1004 ~ warn3 DWORD reloc1 ; warning - D24 is not supported for relocation18 1004 ~ Swarn1 BYTE high reloc1 ; relunstable-ok ; suppressed warning19 1004 ~ Swarn2 D24 reloc1 ; relunstable-ok ; suppressed warning20 1004 ~ Swarn3 DWORD reloc1 ; relunstable-ok ; suppressed warning21 1004 ENDS22 100423 1004 reloc1:24 100425 1004 ; instancing the struct in relocatable block26 1004 12 DC 87 04 .t1 st1 {} ; default "relInit" value is to be relocated26 1008 10 06 01 0826 100C 20 08 20 1026 1010 04 10 00 0426 1014 10 00 00 1026 1018 04 10 00 0426 101C 10 00 0027 101F 12 04 10 DC .t2 st1 {,reloc1,absolute1} ; "y" to be relocated, "relInit" NOT (absolute value)27 1023 87 06 01 0827 1027 20 08 20 1027 102B 04 10 00 0427 102F 10 00 00 1027 1033 04 10 00 0427 1037 10 00 0028 103A ; warning about non-word membersrelocation_struct.asm(29): warning[relunstable]: Relocation makes one of the expressions unstable, resulting machine code is not relocatable29 103A 10 12 34 56 .t3 st1 {high reloc1, $3412, $7856}29 103E 78 06 01 0829 1042 20 08 20 1029 1046 04 10 00 0429 104A 10 00 00 1029 104E 04 10 00 0429 1052 10 00 0030 1055 10 12 34 56 .t4 st1 {high reloc1, $3412, $7856} ; relunstable-ok ; suppressed warning30 1059 78 06 01 0830 105D 20 08 20 1030 1061 04 10 00 0430 1065 10 00 00 1030 1069 04 10 00 0430 106D 10 00 0031 1070 ; warning about unrelocatable valuerelocation_struct.asm(32): warning[reldiverts]: Expression can't be relocated by simple "+offset" mechanics, value diverts differently.32 1070 12 DC 87 08 .t5 st1 {,, 2*reloc1}32 1074 20 06 01 0832 1078 20 08 20 1032 107C 04 10 00 0432 1080 10 00 00 1032 1084 04 10 00 0432 1088 10 00 0033 108B 12 DC 87 08 .t6 st1 {,, 2*reloc1} ; reldiverts-ok ; suppressed warning33 108F 20 06 01 0833 1093 20 08 20 1033 1097 04 10 00 0433 109B 10 00 00 1033 109F 04 10 00 0433 10A3 10 00 0034 10A635 10A6 DD 21 04 10 ld ix,reloc1.t1 ; to be relocated (address of instance)36 10AA FD 21 1F 10 ld iy,.t2 ; to be relocated (address of instance)37 10AE38 10AE ; using the struct offsets - no relocation data needed (offsets are relative values)39 10AE DD 7E 00 ld a,(ix+st1.x)40 10B1 DD 7E 01 ld a,(ix+st1.y)41 10B4 DD 7E 03 ld a,(ix+st1.relInit)42 10B7 DD 7E 05 ld a,(ix+st1.noRel)43 10BA 3E 1B ld a,st1 ; struct length is absolute44 10BC45 10BC ; using struct addresses - to be relocated46 10BC 3A 04 10 ld a,(reloc1.t1.x)47 10BF 2A 05 10 ld hl,(reloc1.t1.y)48 10C2 ED 5B 07 10 ld de,(reloc1.t1.relInit)49 10C6 ED 4B 09 10 ld bc,(reloc1.t1.noRel)50 10CA 3A 1F 10 ld a,(.t2.x)51 10CD 2A 20 10 ld hl,(.t2.y)52 10D0 ED 5B 22 10 ld de,(.t2.relInit)53 10D4 ED 4B 24 10 ld bc,(.t2.noRel)54 10D855 10D8 ; using absolute struct instance = to be ignored56 10D8 3A DC 87 ld a,(absolute1.t1.x)57 10DB 2A DD 87 ld hl,(absolute1.t1.y)58 10DE ED 5B DF 87 ld de,(absolute1.t1.relInit)59 10E2 ED 4B E1 87 ld bc,(absolute1.t1.noRel)60 10E661 10E6 ; using alias instance placed at particular address62 10E6 akaT1 st1 = .t1 ; transitive relocation - to be relocated63 10E6 3A 04 10 ld a,(akaT1.x)64 10E9 2A 05 10 ld hl,(akaT1.y)65 10EC ED 5B 07 10 ld de,(akaT1.relInit)66 10F0 ED 4B 09 10 ld bc,(akaT1.noRel)67 10F4 DD 21 04 10 ld ix,akaT168 10F869 10F8 ; same alias test, but with absolute instance = no relocation data70 10F8 akaA1 st1 = absolute1.t171 10F8 3A DC 87 ld a,(akaA1.x)72 10FB 2A DD 87 ld hl,(akaA1.y)73 10FE ED 5B DF 87 ld de,(akaA1.relInit)74 1102 ED 4B E1 87 ld bc,(akaA1.noRel)75 1106 DD 21 DC 87 ld ix,akaA176 110A77 110A reloc2:78 110A RELOCATE_END79 110A80 110A ORG $200081 2000 07 10 20 10 RELOCATE_TABLE81 2004 A8 10 AC 1081 2008 BD 10 C0 1081 200C C4 10 C8 1081 2010 CB 10 CE 1081 2014 D2 10 D6 1081 2018 E7 10 EA 1081 201C EE 10 F2 1081 2020 F6 1082 202283 2022 ; no relocation area (no warnings, no relocation data)84 2022 ORG $87DC85 87DC absolute1:86 87DC87 87DC ; instancing the struct in absolute block - NOTHING to be relocated88 87DC 12 DC 87 04 .t1 st1 {}88 87E0 10 06 01 0888 87E4 20 08 20 1088 87E8 04 10 00 0488 87EC 10 00 00 1088 87F0 04 10 00 0488 87F4 10 00 0089 87F7 12 04 10 DC .t2 st1 {,reloc1,absolute1}89 87FB 87 06 01 0889 87FF 20 08 20 1089 8803 04 10 00 0489 8807 10 00 00 1089 880B 04 10 00 0489 880F 10 00 0090 8812 ; no warning about unstable values or value being different91 8812 10 DC 87 04 .t3 st1 {high reloc1}91 8816 10 06 01 0891 881A 20 08 20 1091 881E 04 10 00 0491 8822 10 00 00 1091 8826 04 10 00 0491 882A 10 00 0092 882D 12 DC 87 08 .t5 st1 {,, 2*reloc1}92 8831 20 06 01 0892 8835 20 08 20 1092 8839 04 10 00 0492 883D 10 00 00 1092 8841 04 10 00 0492 8845 10 00 0093 884894 8848 DD 21 04 10 ld ix,reloc1.t1 ; not to be relocated even when using relocatable instance95 884C FD 21 F7 87 ld iy,absolute1.t296 885097 8850 ; using the struct offsets - no relocation data needed (offsets are relative values)98 8850 DD 7E 00 ld a,(ix+st1.x)99 8853 DD 7E 01 ld a,(ix+st1.y)100 8856 DD 7E 03 ld a,(ix+st1.relInit)101 8859 DD 7E 05 ld a,(ix+st1.noRel)102 885C103 885C ; using struct addresses (relocatable ones and absolute ones - either should be NOT relocated)104 885C 3A 04 10 ld a,(reloc1.t1.x)105 885F 2A 05 10 ld hl,(reloc1.t1.y)106 8862 ED 5B 07 10 ld de,(reloc1.t1.relInit)107 8866 ED 4B 09 10 ld bc,(reloc1.t1.noRel)108 886A 3A F7 87 ld a,(absolute1.t2.x)109 886D 2A F8 87 ld hl,(absolute1.t2.y)110 8870 ED 5B FA 87 ld de,(absolute1.t2.relInit)111 8874 ED 4B FC 87 ld bc,(absolute1.t2.noRel)112 8878113 8878 ; using relocatable alias (not outside of block = no relocation)114 8878 3A 04 10 ld a,(akaT1.x)115 887B 2A 05 10 ld hl,(akaT1.y)116 887E ED 5B 07 10 ld de,(akaT1.relInit)117 8882 ED 4B 09 10 ld bc,(akaT1.noRel)118 8886 DD 21 04 10 ld ix,akaT1119 888A120 888A ASSERT 0 == 0121 888A ASSERT 6 == 6122 888A# file closed: relocation_struct.asmValue Label------ - -----------------------------------------------------------0x87DC absolute10x87DC absolute1.t10x87E3 X absolute1.t1.badRel0x87E5 X absolute1.t1.badRel20x87E1 absolute1.t1.noRel0x87DF absolute1.t1.relInit0x87EF X absolute1.t1.Swarn10x87F0 X absolute1.t1.Swarn20x87F3 X absolute1.t1.Swarn30x87E7 X absolute1.t1.warn10x87E8 X absolute1.t1.warn20x87EB X absolute1.t1.warn30x87DC absolute1.t1.x0x87DD absolute1.t1.y0x87F7 absolute1.t20x87FE X absolute1.t2.badRel0x8800 X absolute1.t2.badRel20x87FC absolute1.t2.noRel0x87FA absolute1.t2.relInit0x880A X absolute1.t2.Swarn10x880B X absolute1.t2.Swarn20x880E X absolute1.t2.Swarn30x8802 X absolute1.t2.warn10x8803 X absolute1.t2.warn20x8806 X absolute1.t2.warn30x87F7 absolute1.t2.x0x87F8 absolute1.t2.y0x8812 X absolute1.t30x8819 X absolute1.t3.badRel0x881B X absolute1.t3.badRel20x8817 X absolute1.t3.noRel0x8815 X absolute1.t3.relInit0x8825 X absolute1.t3.Swarn10x8826 X absolute1.t3.Swarn20x8829 X absolute1.t3.Swarn30x881D X absolute1.t3.warn10x881E X absolute1.t3.warn20x8821 X absolute1.t3.warn30x8812 X absolute1.t3.x0x8813 X absolute1.t3.y0x882D X absolute1.t50x8834 X absolute1.t5.badRel0x8836 X absolute1.t5.badRel20x8832 X absolute1.t5.noRel0x8830 X absolute1.t5.relInit0x8840 X absolute1.t5.Swarn10x8841 X absolute1.t5.Swarn20x8844 X absolute1.t5.Swarn30x8838 X absolute1.t5.warn10x8839 X absolute1.t5.warn20x883C X absolute1.t5.warn30x882D X absolute1.t5.x0x882E X absolute1.t5.y0x87DC akaA10x87E3 X akaA1.badRel0x87E5 X akaA1.badRel20x87E1 akaA1.noRel0x87DF akaA1.relInit0x87EF X akaA1.Swarn10x87F0 X akaA1.Swarn20x87F3 X akaA1.Swarn30x87E7 X akaA1.warn10x87E8 X akaA1.warn20x87EB X akaA1.warn30x87DC akaA1.x0x87DD akaA1.y0x1004 akaT10x100B X akaT1.badRel0x100D X akaT1.badRel20x1009 akaT1.noRel0x1007 akaT1.relInit0x1017 X akaT1.Swarn10x1018 X akaT1.Swarn20x101B X akaT1.Swarn30x100F X akaT1.warn10x1010 X akaT1.warn20x1013 X akaT1.warn30x1004 akaT1.x0x1005 akaT1.y0x1004 reloc10x1004 reloc1.t10x100B X reloc1.t1.badRel0x100D X reloc1.t1.badRel20x1009 reloc1.t1.noRel0x1007 reloc1.t1.relInit0x1017 X reloc1.t1.Swarn10x1018 X reloc1.t1.Swarn20x101B X reloc1.t1.Swarn30x100F X reloc1.t1.warn10x1010 X reloc1.t1.warn20x1013 X reloc1.t1.warn30x1004 reloc1.t1.x0x1005 reloc1.t1.y0x101F reloc1.t20x1026 X reloc1.t2.badRel0x1028 X reloc1.t2.badRel20x1024 reloc1.t2.noRel0x1022 reloc1.t2.relInit0x1032 X reloc1.t2.Swarn10x1033 X reloc1.t2.Swarn20x1036 X reloc1.t2.Swarn30x102A X reloc1.t2.warn10x102B X reloc1.t2.warn20x102E X reloc1.t2.warn30x101F reloc1.t2.x0x1020 reloc1.t2.y0x103A X reloc1.t30x1041 X reloc1.t3.badRel0x1043 X reloc1.t3.badRel20x103F X reloc1.t3.noRel0x103D X reloc1.t3.relInit0x104D X reloc1.t3.Swarn10x104E X reloc1.t3.Swarn20x1051 X reloc1.t3.Swarn30x1045 X reloc1.t3.warn10x1046 X reloc1.t3.warn20x1049 X reloc1.t3.warn30x103A X reloc1.t3.x0x103B X reloc1.t3.y0x1055 X reloc1.t40x105C X reloc1.t4.badRel0x105E X reloc1.t4.badRel20x105A X reloc1.t4.noRel0x1058 X reloc1.t4.relInit0x1068 X reloc1.t4.Swarn10x1069 X reloc1.t4.Swarn20x106C X reloc1.t4.Swarn30x1060 X reloc1.t4.warn10x1061 X reloc1.t4.warn20x1064 X reloc1.t4.warn30x1055 X reloc1.t4.x0x1056 X reloc1.t4.y0x1070 X reloc1.t50x1077 X reloc1.t5.badRel0x1079 X reloc1.t5.badRel20x1075 X reloc1.t5.noRel0x1073 X reloc1.t5.relInit0x1083 X reloc1.t5.Swarn10x1084 X reloc1.t5.Swarn20x1087 X reloc1.t5.Swarn30x107B X reloc1.t5.warn10x107C X reloc1.t5.warn20x107F X reloc1.t5.warn30x1070 X reloc1.t5.x0x1071 X reloc1.t5.y0x108B X reloc1.t60x1092 X reloc1.t6.badRel0x1094 X reloc1.t6.badRel20x1090 X reloc1.t6.noRel0x108E X reloc1.t6.relInit0x109E X reloc1.t6.Swarn10x109F X reloc1.t6.Swarn20x10A2 X reloc1.t6.Swarn30x1096 X reloc1.t6.warn10x1097 X reloc1.t6.warn20x109A X reloc1.t6.warn30x108B X reloc1.t6.x0x108C X reloc1.t6.y0x110A reloc20x0011 relocate_count0x0022 relocate_size0x001B st10x0007 X st1.badRel0x0009 X st1.badRel20x0005 st1.noRel0x0003 st1.relInit0x0013 X st1.Swarn10x0014 X st1.Swarn20x0017 X st1.Swarn30x000B X st1.warn10x000C X st1.warn20x000F X st1.warn30x0000 st1.x0x0001 st1.y