| Index | Manual | Download | Source | Macros | Embedded word Case ins.
Sitemap | Links | Forum | Tests | Projects

# Test t1713: Literal symbols with relocations and recursion

Tested procedures
  SymCreateLiteral

Source & expected listing t1713.htm.lst
  `| | EUROASM LIST=ON,AUTOALIGN=OFF,AUTOSEGMENT=ON,DUMPWIDTH=26 | |t1713 PROGRAM FORMAT=BIN,MODEL=FLAT,WIDTH=32,IMAGEBASE=0x5000, \ | | LISTMAP=ON,LISTGLOBALS=OFF,LISTLITERALS=ON |[.text] |[.text] | |;; Data literals with similar value: |00000000:B9[00000000] | MOV ECX,=D 0x1111_1111 ; First reference of literal is its definition, too. |00000005:BA[00000000] | MOV EDX,=D 0x1111_1111 ; Same value, same notation. |0000000A:BB[00000000] | MOV EBX,= D 1111_1111h ; Same scalar value, different notation. | |;; Arithmetic operations with literals: |0000000F:BE[01000000] | MOV ESI,1 + = D 0x1111_1111 ; Incremented address of literal with value 0x1111_1111. |00000014:BF[04000000] | MOV EDI,= D(0x1111_1111 + 1) ; Address of literal with incremented value 0x1111_1112. |00000019:BD[04000000] | MOV EBP,= D 0x1111_1111 + 1 ; Address of literal with incremented value 0x1111_1112. |0000001E:A1[04000000] | MOV EAX,[=D 0x1111_1111 + 1] ; Load from address of literal with value 0x1111_1112. |00000023:8B0D[01000000] | MOV ECX,[1+=D 0x1111_1111] ; Load from incremented address of literal 0x1111_1111. | |;; Relocations in literal data: |00000029:B9[08000000] | MOV ECX,=D MemDword: ; Address of literal which contains relocatable address. |0000002E:BA[08000000] | MOV EDX,=D MemDword: ; Same relocatable value, same notation. |00000033:BB[0C000000] | MOV EBX,=D MemDword ; Same relocatable value, different notation. | |;; Recursive data literals: |00000038:BE[10000000] | MOV ESI,=D =D MemDword: ; Addres of literal which contains address of other literal. |0000003D:BF[14000000] | MOV EDI,=D =D =D MemDword: ; Addres of literal which contains address of other literal which contains address of other literal | |;; Code literals with similar value: |00000042:B9[00000000] | MOV ECX,=I"STOSD" ; Address of an instruction assembled to machine code. |00000047:BA[00000000] | MOV EDX,=I"STOSD" ; Same value, same notation. |0000004C:BA[00000000] | MOV EDX,=i"stosd" ; Same value, different notation. | |;; Relocations in literal data: |00000051:BB[01000000] | MOV EBX,=I"MOV EAX,MemDword" ; Literal with relocation in code. |00000056:BD[01000000] | MOV EBP,=I"MOV EAX,MemDword" ; Same value, same notation. |0000005B:BC[06000000] | MOV ESP,=I"mov eax,MemDword:"; Same value, different notation. |00000060: | ; Recursive code literals: |00000060:BE[0C000000] | MOV ESI,=I"MOV EAX,=I'RETN'" ; This defines two code literals. |00000065:BF[11000000] | MOV EDI,=I"MOV EAX,=D'7777'" ; This defines one code and one data literal. |0000006A:BD[16000000] | MOV EBP,=I"MOV EAX,=I""MOV EAX,=D'7777'""" |[.data] |[.data] |00000000:333333 | D 3 * BYTE 0x33 ; Intentional disalignment of MemDword. |00000003:44444444 |MemDword:D DWORD 0x4444_4444 ; DWORD memory variable at [.data]:0000_0003. |[@LT4] ====ListLiterals in section [@LT4]. |00000000:11111111 =D 0x1111_1111 |00000000:11111111 = D 1111_1111h |00000000:11111111 = D 0x1111_1111 |00000004:12111111 = D(0x1111_1111 + 1) |00000004:12111111 = D 0x1111_1111 + 1 |00000004:12111111 =D 0x1111_1111 + 1 |00000008:[03000000] =D MemDword: |0000000C:[03000000] =D MemDword |00000010:[08000000] =D =D MemDword: |00000014:[10000000] =D =D =D MemDword: |00000018:37373737 =D'7777' |[@RT0] ====ListLiterals in section [@RT0]. |00000000:AB =I"STOSD" |00000000:AB =i"stosd" |00000001:B8[03000000] =I"MOV EAX,MemDword" |00000006:B8[03000000] =I"mov eax,MemDword:" |0000000B:C3 =I'RETN' |0000000C:B8[0B000000] =I"MOV EAX,=I'RETN'" |00000011:B8[18000000] =I"MOV EAX,=D'7777'" |00000016:B8[11000000] =I"MOV EAX,=I""MOV EAX,=D'7777'""" | | ENDPROGRAM t1713 | **** ListMap "t1713.bin",model=FLAT,groups=0,segments=3,entry=,stack= | [.text],FA=00000000h,VA=00005000h,size=0000008Ah=138,width=32,align=0010h,purpose=CODE+LITERAL | [.rodata],FA=00000090h,VA=00005090h,size=0000001Ch=28,width=32,align=0010h,purpose=RODATA+LITERAL | [.data],FA=000000B0h,VA=000050B0h,size=00000007h=7,width=32,align=0010h,purpose=DATA`

Expected messages t1713.out
  `I0180 Assembling source file "t1713.htm". I0270 Assembling source "t1713". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t1713". "t1713.htm"{49} I0510 Assembling program pass 1. "t1713.htm"{49} I0510 Assembling program pass 2. "t1713.htm"{49} I0530 Assembling program pass 3 - final. "t1713.htm"{49} I0660 32bit FLAT BIN file "t1713.bin" created, size=183. "t1713.htm"{105} I0650 Program "t1713" assembled in 3 passes with errorlevel 0. "t1713.htm"{105} I0750 Source "t1713" (144 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t1713.htm.lst" created, size=4616. I0990 EuroAssembler terminated with errorlevel 0.`

Expected output file t1713. bin

      0000: B9 90 50 00 00 BA 90 50 00 00 BB 90 50 00 00 BE  ¤¤P°°¤¤P°°¤¤P°°¤
      0010: 91 50 00 00 BF 94 50 00 00 BD 94 50 00 00 A1 94  ¤P°°¤¤P°°¤¤P°°¤¤
      0020: 50 00 00 8B 0D 91 50 00 00 B9 98 50 00 00 BA 98  P°°¤·¤P°°¤¤P°°¤¤
      0030: 50 00 00 BB 9C 50 00 00 BE A0 50 00 00 BF A4 50  P°°¤¤P°°¤¤P°°¤¤P
      0040: 00 00 B9 6F 50 00 00 BA 6F 50 00 00 BA 6F 50 00  °°¤oP°°¤oP°°¤oP°
      0050: 00 BB 70 50 00 00 BD 70 50 00 00 BC 75 50 00 00  °¤pP°°¤pP°°¤uP°°
      0060: BE 7B 50 00 00 BF 80 50 00 00 BD 85 50 00 00 AB  ¤{P°°¤¤P°°¤¤P°°¤
      0070: B8 B3 50 00 00 B8 B3 50 00 00 C3 B8 7A 50 00 00  ¤¤P°°¤¤P°°¤¤zP°°
      0080: B8 A8 50 00 00 B8 80 50 00 00 00 00 00 00 00 00  ¤¤P°°¤¤P°°°°°°°°
      0090: 11 11 11 11 12 11 11 11 B3 50 00 00 B3 50 00 00  ········¤P°°¤P°°
      00A0: 98 50 00 00 A0 50 00 00 37 37 37 37 00 00 00 00  ¤P°°¤P°°7777°°°°
      00B0: 33 33 33 44 44 44 44                             333DDDD

▲Back to the top▲