EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t9733: ELF object module for 32bit Linux links ELFSO library


Source & expected listing t9733.htm.lst
| | EUROASM AUTOSEGMENT=ON,CPU=386,DUMPWIDTH=28 |7439373333 |%test %SET t9733 | |;; | |;; Create the auxiliary ELFSO library | |%test.WBE PROGRAM FORMAT=ELFSO,MODEL=FLAT,WIDTH=32 |[.text] ::::Section changed. |00000000: |Write.L32:: PROC ; Display ASCIIZ string pointed to by ESI using 32bit Linux. |00000000:31C9 | XOR ECX,ECX ; Clear ECX to keep the size of input string. |00000002:31C0 | XOR EAX,EAX ; Clear AL, the searched terminating character |00000004:89F7 | MOV EDI,ESI ; String address. |00000006:F7D1 | NOT ECX ; Assume unlimited possible string size. |00000008:F2AE | REPNE SCASB ; Find the zero terminator. |0000000A:F7D1 | NOT ECX ; Get string size to RCX. |0000000C:B804000000 | MOV EAX,4 ; Kernel service sys_write. |00000011:BB01000000 | MOV EBX,1 ; %1 I/O handle STDOUT_FILENO. |00000016:89CA | MOV EDX,ECX ; %3 String size. |00000018:89F1 | MOV ECX,ESI ; %2 String address. |0000001A:CD80 | INT 0x80 ; Invoke kernel. |0000001C:C3 | RET ; Return to caller. EAX,EBX,ECX,EDX,ESI,EDI are clobbered. |0000001D: | ENDPROC Write.L32: | |;; |0000001D: |Beep.L32:: PROC ; Display message "Beeping.." and play a sound using 32bit Linux. |0000001D:8D35[00000000] | LEA ESI,[=B"Beeping..."] ; Define a literal string in [.rodata]. |00000023:E8D8FFFFFF | CALL Write.L32:: ; Display the notification "Beeping...". |00000028:8D35[00000000] | LEA ESI,[=W(0x0007)] ; Define ASCIIZ string with BEL character in [.rodata]. |0000002E:E8CDFFFFFF | CALL Write.L32:: ; Play the beep sound. |00000033:C3 | RET ; Return to caller. RAX,RCX,RDX,RSI,RDI,R11 are clobbered. |00000034: | ENDPROC Beep.L32: | |;; |00000034: |Exit.L32:: PROC ; Display message "End", terminate the program. |00000034:8D35[00000000] | LEA ESI,[.M:] ; String "End" will be defined in segment [.bss] at ESI. |0000003A:C706456E6400 | MOVD [ESI+0],"End" ; Dynamically define the message "End". |00000040:C746030A000000 | MOVD [ESI+3],0x0A ; LF+NUL. |00000047:E8B4FFFFFF | CALL Write.L32:: ; Display the notification "End". |0000004C:31DB | XOR EBX,EBX ; %1 Errorlevel=0. |0000004E:B801000000 | MOV EAX,1 ; Kernel service sys_exit. |00000053:CD80 | INT 0x80 ; Invoke kernel. No return to caller. |[.bss] ::::Section changed. |00000000:.............. |.M:DB 7*BYTE ; Reserve space for ASCIIZ string "End" in [.bss]. |[.text] ::::Section changed. |00000055: | ENDPROC Exit.L32: |[@LT2] ====ListLiterals in section [@LT2]. |00000000:0700 =W(0x0007) |[@LT1] ====ListLiterals in section [@LT1]. |00000000:42656570696E672E~=B"Beeping..." | |ENDPROGRAM %test.WBE | **** ListMap "t9733.WBE.so",model=FLAT,groups=5,segments=12,entry=,stack= | [LOAD.HDR],FA=00000000h,RVA=00000000h,size=00000605h=1541,group [.symtab] [.dynsym] [.hash] [.dynstr] [.strtab] [.shstrtab] | [],FA=00000000h,RVA=00000000h,size=00000000h=0,width=0,align=0,purpose= | [.symtab],FA=000002C0h,RVA=000002C0h,size=000000E0h=224,width=0,align=0010h,purpose=SYMBOLS | [.dynsym],FA=000003A0h,RVA=000003A0h,size=000000D0h=208,width=0,align=0010h,purpose=SYMBOLS | [.rel.text],FA=00000470h,RVA=00000470h,size=00000018h=24,width=0,align=8,purpose=RELOC | [.hash],FA=00000488h,RVA=00000488h,size=00000048h=72,width=0,align=4,purpose=HASH | [.dynstr],FA=000004D0h,RVA=000004D0h,size=00000075h=117,width=0,align=1,purpose=STRINGS | [.strtab],FA=00000545h,RVA=00000545h,size=00000069h=105,width=0,align=1,purpose=STRINGS | [.shstrtab],FA=000005AEh,RVA=000005AEh,size=00000057h=87,width=0,align=1,purpose=STRINGS | [LOAD.CODE],FA=00001000h,RVA=00001000h,size=00000055h=85,group [.text] | [.text],FA=00001000h,RVA=00001000h,size=00000055h=85,width=32,align=0010h,purpose=CODE | [LOAD.RODATA],FA=00002000h,RVA=00002000h,size=0000000Dh=13,group [.rodata] | [.rodata],FA=00002000h,RVA=00002000h,size=0000000Dh=13,width=32,align=0010h,purpose=RODATA+LITERAL | [LOAD.DATA],FA=00003000h,RVA=00003000h,size=00000057h=87,group [.dynamic] [.bss] | [.dynamic],FA=00003000h,RVA=00003000h,size=00000050h=80,width=0,align=8,purpose=DYNAMIC | [.bss],FA=00003050h,RVA=00003050h,size=00000007h=7,width=32,align=0010h,purpose=BSS | [DYNAMIC],FA=00003000h,RVA=00003000h,size=00000050h=80,group | **** ListGlobals "t9733.WBE.so",Global=0,Public=3,Extern=0,eXport=0,Import=0 | Beep.L32,[.text]:0000001Dh,scope='P' | Exit.L32,[.text]:00000034h,scope='P' | Write.L32,[.text]:00000000h,scope='P' | |;; | |;; Create the main ELF module | |%test PROGRAM FORMAT=ELF,MODEL=FLAT,WIDTH=32,ENTRY=Start: | | LINK %test.WBE.so |[.text] ::::Section changed. |00000000:90 |Start:NOP ; Entry point of the executable program. |00000001:BE[00000000] | MOV ESI,Msg: ; Address of the initial message in section [.data]. |00000006:E8(00000000) | CALL Write.L32:: ; Display the message. |0000000B:E8(00000000) | CALL Beep.L32:: ; Play a beep sound. |00000010:E8(00000000) | CALL Exit.L32:: ; Terminate the program. |[.data] ::::Section changed. |00000000:333262697420464C~|Msg:DB '%^WIDTH[]bit %^MODEL %^FORMAT program "%^OUTFILE".',10,0 | |ENDPROGRAM %test |# I0561 Linking ELFSO library "./t9733.WBE.so". | **** ListMap "t9733.o",model=FLAT,groups=0,segments=10,entry=Start:,stack= | [],FA=00000000h,RVA=00000000h,size=00000000h=0,width=0,align=0,purpose= | [.symtab],FA=000001D0h,RVA=00000000h,size=000000D0h=208,width=0,align=0010h,purpose=SYMBOLS | [.rel.text],FA=000002A0h,RVA=00000000h,size=00000020h=32,width=0,align=8,purpose=RELOC | [.drectve],FA=000002C0h,RVA=00000000h,size=0000002Ch=44,width=0,align=4,purpose=DRECTVE | [.strtab],FA=000002ECh,RVA=00000000h,size=0000005Fh=95,width=0,align=1,purpose=STRINGS | [.shstrtab],FA=0000034Bh,RVA=00000000h,size=00000047h=71,width=0,align=1,purpose=STRINGS | [.text],FA=000003A0h,RVA=00000000h,size=00000075h=117,width=32,align=0010h,purpose=CODE | [.rodata],FA=00000420h,RVA=00000000h,size=0000000Dh=13,width=32,align=0010h,purpose=RODATA | [.data],FA=00000430h,RVA=00000000h,size=00000023h=35,width=32,align=0010h,purpose=DATA | [.bss],FA=00000460h,RVA=00000000h,size=00000007h=7,width=32,align=0010h,purpose=BSS | **** ListGlobals "t9733.o",Global=0,Public=4,Extern=0,eXport=0,Import=0 | Beep.L32,[.text]:0000003Dh,scope='P' | Exit.L32,[.text]:00000054h,scope='P' | Start,[.text]:00000000h,scope='P' | Write.L32,[.text]:00000020h,scope='P'
Expected messages t9733.out
I0180 Assembling source file "t9733.htm". I0270 Assembling source "t9733". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t9733.WBE". "t9733.htm"{45} I0510 Assembling program pass 1. "t9733.htm"{45} I0510 Assembling program pass 2. "t9733.htm"{45} I0530 Assembling program pass 3 - final. "t9733.htm"{45} I0660 32bit FLAT ELFSO file "t9733.WBE.so" created, size=12368. "t9733.htm"{86} I0650 Program "t9733.WBE" assembled in 3 passes with errorlevel 0. "t9733.htm"{86} I0470 Assembling program "t9733". "t9733.htm"{111} I0510 Assembling program pass 1. "t9733.htm"{111} I0510 Assembling program pass 2. "t9733.htm"{111} I0530 Assembling program pass 3 - final. "t9733.htm"{111} I0561 Linking ELFSO library "./t9733.WBE.so". "t9733.htm"{121} I0660 32bit FLAT ELF file "t9733.o" created, size=1107. "t9733.htm"{121} I0650 Program "t9733" assembled in 3 passes with errorlevel 0. "t9733.htm"{121} I0750 Source "t9733" (238 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t9733.htm.lst" created, size=7791. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t9733. o
0000: 7F 45 4C 46 01 01 01 00 00 00 00 00 00 00 00 00  ¤ELF···°°°°°°°°°
0010: 01 00 03 00 01 00 00 00 00 00 00 00 00 00 00 00  ·°·°·°°°°°°°°°°°
0020: 38 00 00 00 00 00 00 00 34 00 20 00 00 00 28 00  8°°°°°°°4°¯°°°(°
0030: 0A 00 05 00 00 00 00 00 00 00 00 00 00 00 00 00  ¬°·°°°°°°°°°°°°°
0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0060: 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00  ·°°°·°°°°°°°°°°°
0070: D0 01 00 00 D0 00 00 00 04 00 00 00 09 00 00 00  ¤·°°¤°°°·°°°·°°°
0080: 10 00 00 00 10 00 00 00 09 00 00 00 09 00 00 00  ·°°°·°°°·°°°·°°°
0090: 02 00 00 00 00 00 00 00 A0 02 00 00 20 00 00 00  ·°°°°°°°¤·°°¯°°°
00A0: 01 00 00 00 06 00 00 00 08 00 00 00 08 00 00 00  ·°°°·°°°·°°°·°°°
00B0: 13 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00  ·°°°·°°°°°°°°°°°
00C0: C0 02 00 00 2C 00 00 00 00 00 00 00 00 00 00 00  ¤·°°,°°°°°°°°°°°
00D0: 04 00 00 00 00 00 00 00 1C 00 00 00 03 00 00 00  ·°°°°°°°·°°°·°°°
00E0: 00 00 00 00 00 00 00 00 EC 02 00 00 5F 00 00 00  °°°°°°°°¤·°°_°°°
00F0: 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00  °°°°°°°°·°°°°°°°
0100: 24 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00  $°°°·°°°°°°°°°°°
0110: 4B 03 00 00 47 00 00 00 00 00 00 00 00 00 00 00  K·°°G°°°°°°°°°°°
0120: 01 00 00 00 00 00 00 00 2E 00 00 00 01 00 00 00  ·°°°°°°°.°°°·°°°
0130: 06 00 00 00 00 00 00 00 A0 03 00 00 75 00 00 00  ·°°°°°°°¤·°°u°°°
0140: 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00  °°°°°°°°·°°°°°°°
0150: 34 00 00 00 01 00 00 00 02 00 00 00 00 00 00 00  4°°°·°°°·°°°°°°°
0160: 20 04 00 00 0D 00 00 00 00 00 00 00 00 00 00 00  ¯·°°·°°°°°°°°°°°
0170: 10 00 00 00 00 00 00 00 3C 00 00 00 01 00 00 00  ·°°°°°°°<°°°·°°°
0180: 03 00 00 00 00 00 00 00 30 04 00 00 23 00 00 00  ·°°°°°°°0·°°#°°°
0190: 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00  °°°°°°°°·°°°°°°°
01A0: 42 00 00 00 08 00 00 00 03 00 00 00 00 00 00 00  B°°°·°°°·°°°°°°°
01B0: 60 04 00 00 07 00 00 00 00 00 00 00 00 00 00 00  `·°°·°°°°°°°°°°°
01C0: 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ·°°°°°°°°°°°°°°°
01D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
01E0: 01 00 00 00 00 00 00 00 00 00 00 00 04 00 F1 FF  ·°°°°°°°°°°°·°¤¤
01F0: 0B 00 00 00 00 00 00 00 00 00 00 00 03 00 09 00  ·°°°°°°°°°°°·°·°
0200: 10 00 00 00 00 00 00 00 00 00 00 00 03 00 08 00  ·°°°°°°°°°°°·°·°
0210: 16 00 00 00 00 00 00 00 00 00 00 00 03 00 03 00  ·°°°°°°°°°°°·°·°
0220: 1F 00 00 00 00 00 00 00 00 00 00 00 03 00 07 00  ·°°°°°°°°°°°·°·°
0230: 27 00 00 00 00 00 00 00 00 00 00 00 03 00 04 00  '°°°°°°°°°°°·°·°
0240: 2F 00 00 00 00 00 00 00 00 00 00 00 03 00 01 00  /°°°°°°°°°°°·°·°
0250: 37 00 00 00 00 00 00 00 00 00 00 00 03 00 06 00  7°°°°°°°°°°°·°·°
0260: 3D 00 00 00 3D 00 00 00 17 00 00 00 12 00 06 00  =°°°=°°°·°°°·°·°
0270: 46 00 00 00 54 00 00 00 21 00 00 00 12 00 06 00  F°°°T°°°!°°°·°·°
0280: 4F 00 00 00 00 00 00 00 01 00 00 00 12 00 06 00  O°°°°°°°·°°°·°·°
0290: 55 00 00 00 20 00 00 00 1D 00 00 00 12 00 06 00  U°°°¯°°°·°°°·°·°
02A0: 02 00 00 00 01 03 00 00 3F 00 00 00 01 05 00 00  ·°°°··°°?°°°··°°
02B0: 4A 00 00 00 01 05 00 00 56 00 00 00 01 02 00 00  J°°°··°°V°°°··°°
02C0: 0D 00 00 00 10 00 00 00 EA 00 00 00 45 75 72 6F  ·°°°·°°°¤°°°Euro
02D0: 41 73 73 65 6D 62 6C 65 72 00 00 00 20 2F 45 4E  Assembler°°°¯/EN
02E0: 54 52 59 3A 53 74 61 72 74 3A 00 00 00 74 39 37  TRY:Start:°°°t97
02F0: 33 33 2E 68 74 6D 00 2E 62 73 73 00 2E 64 61 74  33.htm°.bss°.dat
0300: 61 00 2E 64 72 65 63 74 76 65 00 2E 72 6F 64 61  a°.drectve°.roda
0310: 74 61 00 2E 73 74 72 74 61 62 00 2E 73 79 6D 74  ta°.strtab°.symt
0320: 61 62 00 2E 74 65 78 74 00 42 65 65 70 2E 4C 33  ab°.text°Beep.L3
0330: 32 00 45 78 69 74 2E 4C 33 32 00 53 74 61 72 74  2°Exit.L32°Start
0340: 00 57 72 69 74 65 2E 4C 33 32 00 00 2E 73 79 6D  °Write.L32°°.sym
0350: 74 61 62 00 2E 72 65 6C 2E 74 65 78 74 00 2E 64  tab°.rel.text°.d
0360: 72 65 63 74 76 65 00 2E 73 74 72 74 61 62 00 2E  rectve°.strtab°.
0370: 73 68 73 74 72 74 61 62 00 2E 74 65 78 74 00 2E  shstrtab°.text°.
0380: 72 6F 64 61 74 61 00 2E 64 61 74 61 00 2E 62 73  rodata°.data°.bs
0390: 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  s°°°°°°°°°°°°°°°
03A0: 90 BE 00 00 00 00 E8 15 00 00 00 E8 2D 00 00 00  ¤¤°°°°¤·°°°¤-°°°
03B0: E8 3F 00 00 00 90 90 90 90 90 90 90 90 90 90 90  ¤?°°°¤¤¤¤¤¤¤¤¤¤¤
03C0: 31 C9 31 C0 89 F7 F7 D1 F2 AE F7 D1 B8 04 00 00  1¤1¤¤¤¤¤¤¤¤¤¤·°°
03D0: 00 BB 01 00 00 00 89 CA 89 F1 CD 80 C3 8D 35 02  °¤·°°°¤¤¤¤¤¤¤¤5·
03E0: 00 00 00 E8 D8 FF FF FF 8D 35 00 00 00 00 E8 CD  °°°¤¤¤¤¤¤5°°°°¤¤
03F0: FF FF FF C3 8D 35 00 00 00 00 C7 06 45 6E 64 00  ¤¤¤¤¤5°°°°¤·End°
0400: C7 46 03 0A 00 00 00 E8 B4 FF FF FF 31 DB B8 01  ¤F·¬°°°¤¤¤¤¤1¤¤·
0410: 00 00 00 CD 80 00 00 00 00 00 00 00 00 00 00 00  °°°¤¤°°°°°°°°°°°
0420: 07 00 42 65 65 70 69 6E 67 2E 2E 2E 00 00 00 00  ·°Beeping...°°°°
0430: 33 32 62 69 74 20 46 4C 41 54 20 45 4C 46 20 70  32bit¯FLAT¯ELF¯p
0440: 72 6F 67 72 61 6D 20 22 74 39 37 33 33 2E 6F 22  rogram¯"t9733.o"
0450: 2E 0A 00                                         .¬°

▲Back to the top▲