EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t3016: 64bit RIP-relative addressing mode


Description
Check the RIP-relative addressing frame when the target needs relocation or when special accumulator addressing mode is used. Although the test is in PE format, it is not intended to be executed.
Tested procedures
IiCreateModRM  
Source & expected listing t3016.htm.lst
| | EUROASM DUMPALL=YES, DUMPWIDTH=31, CPU=X64, AMD=YES | |t3016 PROGRAM FORMAT=PE, WIDTH=64, ICONFILE=, ENTRY=Main, \ | | FILEALIGN=32, SECTIONALIGN=4K, IMAGEBASE=4M, \ | | LISTMAP=YES, LISTGLOBALS=YES |[.text] |[.text] |00000000:90 |Main: NOP |00000001: |; Intrasegment ModR/M addressing mode. Asm-time relocations. |00000001:8A0DCA000000 | MOV CL,[CodeByte] |00000007:8A0DC4000000 | MOV CL,[CodeByte],ADDR=REL |0000000D:8A0C25[D1000000] | MOV CL,[CodeByte],ADDR=ABS |00000014:8A05B7000000 | MOV AL,[CodeByte],CODE=LONG |0000001A:8A05B1000000 | MOV AL,[CodeByte],CODE=LONG,ADDR=REL |00000020:8A0425[D1000000] | MOV AL,[CodeByte],CODE=LONG,ADDR=ABS |00000027: |; Intersegment ModR/M addressing mode. Link-time relocations. |00000027:8A0D(01000000) | MOV CL,[DataByte] |0000002D:8A0D(01000000) | MOV CL,[DataByte],ADDR=REL |00000033:8A0C25[01000000] | MOV CL,[DataByte],ADDR=ABS |0000003A:8A05(01000000) | MOV AL,[DataByte],CODE=LONG |00000040:8A05(01000000) | MOV AL,[DataByte],CODE=LONG,ADDR=REL |00000046:8A0425[01000000] | MOV AL,[DataByte],CODE=LONG,ADDR=ABS |0000004D: |; Intrasegment accumulator addressing mode. ABS addressing only. |0000004D:67A0[D1000000] | MOV AL,[CodeByte] |00000053:67A0[D1000000] | MOV AL,[CodeByte],ADDR=ABS |00000059:67A0[D1000000] | MOV AL,[CodeByte],ADDR=REL ; W2401 expected. |## W2401 Modifier "ADDR=REL" could not be obeyed in this instruction. |0000005F:67A0[D1000000] | MOV AL,[CodeByte],DISP=DWORD |00000065:67A0[D1000000] | MOV AL,[CodeByte],DISP=DWORD,ADDR=ABS |0000006B:67A0[D1000000] | MOV AL,[CodeByte],DISP=DWORD,ADDR=REL ; W2401 expected. |## W2401 Modifier "ADDR=REL" could not be obeyed in this instruction. |00000071:A0[D100000000000000]| MOV AL,[CodeByte],DISP=QWORD |0000007A:A0[D100000000000000]| MOV AL,[CodeByte],DISP=QWORD,ADDR=ABS |00000083:A0[D100000000000000]| MOV AL,[CodeByte],DISP=QWORD,ADDR=REL ; W2401 expected. |## W2401 Modifier "ADDR=REL" could not be obeyed in this instruction. |0000008C: |; Intersegment accumulator addressing mode. ABS addressing only. |0000008C:67A0[01000000] | MOV AL,[DataByte] |00000092:67A0[01000000] | MOV AL,[DataByte],ADDR=ABS |00000098:67A0[01000000] | MOV AL,[DataByte],ADDR=REL ; W2401 expected. |## W2401 Modifier "ADDR=REL" could not be obeyed in this instruction. |0000009E:67A0[01000000] | MOV AL,[DataByte],DISP=DWORD |000000A4:67A0[01000000] | MOV AL,[DataByte],DISP=DWORD,ADDR=ABS |000000AA:67A0[01000000] | MOV AL,[DataByte],DISP=DWORD,ADDR=REL ; W2401 expected. |## W2401 Modifier "ADDR=REL" could not be obeyed in this instruction. |000000B0:A0[0100000000000000]| MOV AL,[DataByte],DISP=QWORD |000000B9:A0[0100000000000000]| MOV AL,[DataByte],DISP=QWORD,ADDR=ABS |000000C2:A0[0100000000000000]| MOV AL,[DataByte],DISP=QWORD,ADDR=REL ; W2401 expected. |## W2401 Modifier "ADDR=REL" could not be obeyed in this instruction. |000000CB:660F1F442000 | ALIGN OWORD,BYTE |000000D1:01 |CodeByte:: D BYTE 1 ; Memory variable defined in the same COFF section. |[.data] |[.data] |00000000:00 | ALIGN OWORD,BYTE |00000001:01 |DataByte:: D BYTE 1 ; Memory variable defined in a different COFF section. | | ENDPROGRAM t3016 | **** ListMap "t3016.exe",model=FLAT,groups=0,segments=3,entry=Main,stack= | [.text],FA=00000220h,VA=00401000h,size=000000D2h=210,width=64,align=0010h,purpose=CODE | [.data],FA=00000300h,VA=00402000h,size=00000002h=2,width=64,align=0010h,purpose=DATA | [.reloc],FA=00000320h,VA=00403000h,size=00000034h=52,width=32,align=4,purpose=BASERELOC | **** ListGlobals "t3016.exe",Global=0,Public=3,Extern=0,eXport=0,Import=0 | CodeByte,[.text]:000000D1h,VA=004010D1h,scope='P' | DataByte,[.data]:00000001h,VA=00402001h,scope='P' | Main,[.text]:00000000h,VA=00401000h,scope='P'
Expected messages t3016.out
I0180 Assembling source file "t3016.htm". I0270 Assembling source "t3016". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t3016". "t3016.htm"{53} I0510 Assembling program pass 1. "t3016.htm"{53} I0510 Assembling program pass 2. "t3016.htm"{53} I0530 Assembling program pass 3 - final. "t3016.htm"{53} W2401 Modifier "ADDR=REL" could not be obeyed in this instruction. "t3016.htm"{75} W2401 Modifier "ADDR=REL" could not be obeyed in this instruction. "t3016.htm"{79} W2401 Modifier "ADDR=REL" could not be obeyed in this instruction. "t3016.htm"{83} W2401 Modifier "ADDR=REL" could not be obeyed in this instruction. "t3016.htm"{88} W2401 Modifier "ADDR=REL" could not be obeyed in this instruction. "t3016.htm"{92} W2401 Modifier "ADDR=REL" could not be obeyed in this instruction. "t3016.htm"{96} I0660 64bit FLAT PE file "t3016.exe" created, size=852. "t3016.htm"{103} I0650 Program "t3016" assembled in 3 passes with errorlevel 2. "t3016.htm"{103} I0750 Source "t3016" (194 lines) assembled in 2 passes with errorlevel 2. I0860 Listing file "t3016.htm.lst" created, size=4490. I0990 EuroAssembler terminated with errorlevel 2.
Expected output file t3016. exe
0000: 4D 5A 89 00 01 00 00 00 04 00 21 00 FF FF 05 00  MZ¤°·°°°·°!°¤¤·°
0010: 00 02 BF A2 00 00 00 00 40 00 00 00 00 00 00 00  °·¤¤°°°°@°°°°°°°
0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0030: 00 00 00 00 00 00 00 00 00 00 00 00 90 00 00 00  °°°°°°°°°°°°¤°°°
0040: 0E 1F BA 0E 00 B4 09 CD 21 B8 08 4C CD 21 54 68  ··¤·°¤·¤!¤·L¤!Th
0050: 69 73 20 70 72 6F 67 72 61 6D 20 77 61 73 20 6C  is¯program¯was¯l
0060: 61 75 6E 63 68 65 64 20 69 6E 20 44 4F 53 20 62  aunched¯in¯DOS¯b
0070: 75 74 20 69 74 20 72 65 71 75 69 72 65 73 20 57  ut¯it¯requires¯W
0080: 69 6E 64 6F 77 73 2E 24 00 00 00 00 00 00 00 00  indows.$°°°°°°°°
0090: 50 45 00 00 64 86 03 00 00 00 00 00 00 00 00 00  PE°°d¤·°°°°°°°°°
00A0: 00 00 00 00 F0 00 22 00 0B 02 01 00 00 10 00 00  °°°°¤°"°···°°·°°
00B0: 00 10 00 00 00 00 00 00 00 10 00 00 00 10 00 00  °·°°°°°°°·°°°·°°
00C0: 00 00 40 00 00 00 00 00 00 10 00 00 20 00 00 00  °°@°°°°°°·°°¯°°°
00D0: 04 00 00 00 01 00 00 00 04 00 00 00 00 00 00 00  ·°°°·°°°·°°°°°°°
00E0: 00 40 00 00 10 02 00 00 00 00 00 00 03 00 0F 00  °@°°··°°°°°°·°·°
00F0: 00 00 10 00 00 00 00 00 00 20 00 00 00 00 00 00  °°·°°°°°°¯°°°°°°
0100: 00 00 00 01 00 00 00 00 00 00 10 00 00 00 00 00  °°°·°°°°°°·°°°°°
0110: 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00  °°°°·°°°°°°°°°°°
0120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0140: 00 30 00 00 34 00 00 00 00 00 00 00 00 00 00 00  °0°°4°°°°°°°°°°°
0150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0190: 00 00 00 00 00 00 00 00 2E 74 65 78 74 00 00 00  °°°°°°°°.text°°°
01A0: 00 10 00 00 00 10 00 00 D2 00 00 00 20 02 00 00  °·°°°·°°¤°°°¯·°°
01B0: 00 00 00 00 00 00 00 00 00 00 00 00 20 00 50 60  °°°°°°°°°°°°¯°P`
01C0: 2E 64 61 74 61 00 00 00 00 10 00 00 00 20 00 00  .data°°°°·°°°¯°°
01D0: 02 00 00 00 00 03 00 00 00 00 00 00 00 00 00 00  ·°°°°·°°°°°°°°°°
01E0: 00 00 00 00 40 00 50 C0 2E 72 65 6C 6F 63 00 00  °°°°@°P¤.reloc°°
01F0: 00 10 00 00 00 30 00 00 34 00 00 00 20 03 00 00  °·°°°0°°4°°°¯·°°
0200: 00 00 00 00 00 00 00 00 00 00 00 00 40 00 30 52  °°°°°°°°°°°°@°0R
0210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0220: 90 8A 0D CA 00 00 00 8A 0D C4 00 00 00 8A 0C 25  ¤¤·¤°°°¤·¤°°°¤·%
0230: D1 10 40 00 8A 05 B7 00 00 00 8A 05 B1 00 00 00  ¤·@°¤·¤°°°¤·¤°°°
0240: 8A 04 25 D1 10 40 00 8A 0D D4 0F 00 00 8A 0D CE  ¤·%¤·@°¤·¤·°°¤·¤
0250: 0F 00 00 8A 0C 25 01 20 40 00 8A 05 C1 0F 00 00  ·°°¤·%·¯@°¤·¤·°°
0260: 8A 05 BB 0F 00 00 8A 04 25 01 20 40 00 67 A0 D1  ¤·¤·°°¤·%·¯@°g¤¤
0270: 10 40 00 67 A0 D1 10 40 00 67 A0 D1 10 40 00 67  ·@°g¤¤·@°g¤¤·@°g
0280: A0 D1 10 40 00 67 A0 D1 10 40 00 67 A0 D1 10 40  ¤¤·@°g¤¤·@°g¤¤·@
0290: 00 A0 D1 10 40 00 00 00 00 00 A0 D1 10 40 00 00  °¤¤·@°°°°°¤¤·@°°
02A0: 00 00 00 A0 D1 10 40 00 00 00 00 00 67 A0 01 20  °°°¤¤·@°°°°°g¤·¯
02B0: 40 00 67 A0 01 20 40 00 67 A0 01 20 40 00 67 A0  @°g¤·¯@°g¤·¯@°g¤
02C0: 01 20 40 00 67 A0 01 20 40 00 67 A0 01 20 40 00  ·¯@°g¤·¯@°g¤·¯@°
02D0: A0 01 20 40 00 00 00 00 00 A0 01 20 40 00 00 00  ¤·¯@°°°°°¤·¯@°°°
02E0: 00 00 A0 01 20 40 00 00 00 00 00 66 0F 1F 44 20  °°¤·¯@°°°°°f··D¯
02F0: 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °·°°°°°°°°°°°°°°
0300: 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °·°°°°°°°°°°°°°°
0310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0320: 00 10 00 00 34 00 00 00 10 30 23 30 36 30 49 30  °·°°4°°°·0#060I0
0330: 4F 30 55 30 5B 30 61 30 67 30 6D 30 72 A0 7B A0  O0U0[0a0g0m0r¤{¤
0340: 84 A0 8E 30 94 30 9A 30 A0 30 A6 30 AC 30 B1 A0  ¤¤¤0¤0¤0¤0¤0¤0¤¤
0350: BA A0 C3 A0                                      ¤¤¤¤

▲Back to the top▲