EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t9283: LIBCOF library for 32bit Linux links ELFSO library


Source & expected listing t9283.htm.lst
| | EUROASM AUTOSEGMENT=ON,CPU=386,DUMPWIDTH=28 |7439323833 |%test %SET t9283 | |;; | |;; 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 "t9283.WBE.so",model=FLAT,groups=5,segments=12,entry=,stack= | [LOAD.HDR],FA=00000000h,RVA=00000000h,size=00000536h=1334,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=00000130h=304,width=0,align=0010h,purpose=SYMBOLS | [.dynsym],FA=000003F0h,RVA=000003F0h,size=00000010h=16,width=0,align=0010h,purpose=SYMBOLS | [.rel.text],FA=00000400h,RVA=00000400h,size=00000018h=24,width=0,align=8,purpose=RELOC | [.hash],FA=00000418h,RVA=00000418h,size=00000018h=24,width=0,align=4,purpose=HASH | [.dynstr],FA=00000430h,RVA=00000430h,size=00000017h=23,width=0,align=1,purpose=STRINGS | [.strtab],FA=00000447h,RVA=00000447h,size=00000098h=152,width=0,align=1,purpose=STRINGS | [.shstrtab],FA=000004DFh,RVA=000004DFh,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 "t9283.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 LIBCOF library | |%test PROGRAM FORMAT=LIBCOF,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 ".\t9283.WBE.so". | **** ListMap "t9283.lib",model=FLAT,groups=0,segments=2,entry=Start:,stack= | [.text],FA=00000064h,RVA=00000000h,size=00000015h=21,width=32,align=0010h,purpose=CODE | [.data],FA=000000A2h,RVA=00000000h,size=00000028h=40,width=32,align=0010h,purpose=DATA | **** ListGlobals "t9283.lib",Global=0,Public=1,Extern=3,eXport=0,Import=0 | Beep.L32,[Beep.L32]:00000000h,scope='E' | Exit.L32,[Exit.L32]:00000000h,scope='E' | Start,[.text]:00000000h,scope='P' | Write.L32,[Write.L32]:00000000h,scope='E'
Expected messages t9283.out
I0180 Assembling source file "t9283.htm". I0270 Assembling source "t9283". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t9283.WBE". "t9283.htm"{45} I0510 Assembling program pass 1. "t9283.htm"{45} I0510 Assembling program pass 2. "t9283.htm"{45} I0530 Assembling program pass 3 - final. "t9283.htm"{45} I0660 32bit FLAT ELFSO file "t9283.WBE.so" created, size=12368. "t9283.htm"{86} I0650 Program "t9283.WBE" assembled in 3 passes with errorlevel 0. "t9283.htm"{86} I0470 Assembling program "t9283". "t9283.htm"{111} I0510 Assembling program pass 1. "t9283.htm"{111} I0510 Assembling program pass 2. "t9283.htm"{111} I0530 Assembling program pass 3 - final. "t9283.htm"{111} I0561 Linking ELFSO library ".\t9283.WBE.so". "t9283.htm"{121} I0660 32bit FLAT LIBCOF file "t9283.lib" created, size=1539. "t9283.htm"{121} I0650 Program "t9283" assembled in 3 passes with errorlevel 0. "t9283.htm"{121} I0750 Source "t9283" (257 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t9283.htm.lst" created, size=7022. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t9283. lib
0000: 21 3C 61 72 63 68 3E 0A 2F 20 20 20 20 20 20 20  !<arch>¬/¯¯¯¯¯¯¯
0010: 20 20 20 20 20 20 20 20 30 20 20 20 20 20 20 20  ¯¯¯¯¯¯¯¯0¯¯¯¯¯¯¯
0020: 20 20 20 20 30 20 20 20 20 20 30 20 20 20 20 20  ¯¯¯¯0¯¯¯¯¯0¯¯¯¯¯
0030: 31 30 30 36 36 36 20 20 31 30 36 20 20 20 20 20  100666¯¯106¯¯¯¯¯
0040: 20 20 60 0A 00 00 00 09 00 00 01 8C 00 00 01 8C  ¯¯`¬°°°·°°·¤°°·¤
0050: 00 00 01 8C 00 00 03 66 00 00 03 66 00 00 03 66  °°·¤°°·f°°·f°°·f
0060: 00 00 03 66 00 00 03 66 00 00 03 66 53 74 61 72  °°·f°°·f°°·fStar
0070: 74 00 2E 74 65 78 74 00 2E 64 61 74 61 00 2E 62  t°.text°.data°.b
0080: 73 73 00 2E 72 6F 64 61 74 61 00 2E 74 65 78 74  ss°.rodata°.text
0090: 00 42 65 65 70 2E 4C 33 32 00 45 78 69 74 2E 4C  °Beep.L32°Exit.L
00A0: 33 32 00 57 72 69 74 65 2E 4C 33 32 00 0A 2F 20  32°Write.L32°¬/¯
00B0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 20  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯0¯
00C0: 20 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20  ¯¯¯¯¯¯¯¯¯¯0¯¯¯¯¯
00D0: 30 20 20 20 20 20 31 30 30 36 36 36 20 20 31 30  0¯¯¯¯¯100666¯¯10
00E0: 30 20 20 20 20 20 20 20 60 0A 02 00 00 00 8C 01  0¯¯¯¯¯¯¯`¬·°°°¤·
00F0: 00 00 66 03 00 00 09 00 00 00 02 00 01 00 02 00  °°f·°°·°°°·°·°·°
0100: 01 00 02 00 02 00 02 00 01 00 02 00 2E 62 73 73  ·°·°·°·°·°·°.bss
0110: 00 2E 64 61 74 61 00 2E 72 6F 64 61 74 61 00 2E  °.data°.rodata°.
0120: 74 65 78 74 00 2E 74 65 78 74 00 42 65 65 70 2E  text°.text°Beep.
0130: 4C 33 32 00 45 78 69 74 2E 4C 33 32 00 53 74 61  L32°Exit.L32°Sta
0140: 72 74 00 57 72 69 74 65 2E 4C 33 32 00 0A 2F 2F  rt°Write.L32°¬//
0150: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 20  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯0¯
0160: 20 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20  ¯¯¯¯¯¯¯¯¯¯0¯¯¯¯¯
0170: 30 20 20 20 20 20 31 30 30 36 36 36 20 20 32 20  0¯¯¯¯¯100666¯¯2¯
0180: 20 20 20 20 20 20 20 20 60 0A 00 0A 74 39 32 38  ¯¯¯¯¯¯¯¯`¬°¬t928
0190: 33 2F 20 20 20 20 20 20 20 20 20 20 30 20 20 20  3/¯¯¯¯¯¯¯¯¯¯0¯¯¯
01A0: 20 20 20 20 20 20 20 20 30 20 20 20 20 20 30 20  ¯¯¯¯¯¯¯¯0¯¯¯¯¯0¯
01B0: 20 20 20 20 31 30 30 36 36 36 20 20 34 31 34 20  ¯¯¯¯100666¯¯414¯
01C0: 20 20 20 20 20 20 60 0A 4C 01 02 00 00 00 00 00  ¯¯¯¯¯¯`¬L··°°°°°
01D0: CA 00 00 00 0B 00 00 00 00 00 00 01 2E 74 65 78  ¤°°°·°°°°°°·.tex
01E0: 74 00 00 00 00 00 00 00 00 00 00 00 15 00 00 00  t°°°°°°°°°°°·°°°
01F0: 64 00 00 00 7A 00 00 00 00 00 00 00 04 00 00 00  d°°°z°°°°°°°·°°°
0200: 20 00 50 60 2E 64 61 74 61 00 00 00 00 00 00 00  ¯°P`.data°°°°°°°
0210: 00 00 00 00 28 00 00 00 A2 00 00 00 00 00 00 00  °°°°(°°°¤°°°°°°°
0220: 00 00 00 00 00 00 00 00 40 00 50 C0 90 BE 00 00  °°°°°°°°@°P¤¤¤°°
0230: 00 00 E8 00 00 00 00 E8 00 00 00 00 E8 00 00 00  °°¤°°°°¤°°°°¤°°°
0240: 00 00 02 00 00 00 02 00 00 00 06 00 07 00 00 00  °°·°°°·°°°·°·°°°
0250: 0A 00 00 00 14 00 0C 00 00 00 07 00 00 00 14 00  ¬°°°·°·°°°·°°°·°
0260: 11 00 00 00 08 00 00 00 14 00 33 32 62 69 74 20  ·°°°·°°°·°32bit¯
0270: 46 4C 41 54 20 4C 49 42 43 4F 46 20 70 72 6F 67  FLAT¯LIBCOF¯prog
0280: 72 61 6D 20 22 74 39 32 38 33 2E 6C 69 62 22 2E  ram¯"t9283.lib".
0290: 0A 00 2E 66 69 6C 65 00 00 00 00 00 00 00 FE FF  ¬°.file°°°°°°°¤¤
02A0: 00 00 67 01 74 39 32 38 33 2E 68 74 6D 00 00 00  °°g·t9283.htm°°°
02B0: 00 00 00 00 00 00 2E 64 61 74 61 00 00 00 00 00  °°°°°°.data°°°°°
02C0: 00 00 02 00 00 00 03 01 28 00 00 00 00 00 00 00  °°·°°°··(°°°°°°°
02D0: 00 00 00 00 00 00 00 00 00 00 2E 74 65 78 74 00  °°°°°°°°°°.text°
02E0: 00 00 00 00 00 00 01 00 00 00 03 01 15 00 00 00  °°°°°°·°°°···°°°
02F0: 04 00 00 00 00 00 00 00 00 00 00 00 00 00 4D 73  ·°°°°°°°°°°°°°Ms
0300: 67 00 00 00 00 00 00 00 00 00 02 00 0C 00 03 00  g°°°°°°°°°·°·°·°
0310: 42 65 65 70 2E 4C 33 32 00 00 00 00 00 00 01 01  Beep.L32°°°°°°··
0320: 02 00 45 78 69 74 2E 4C 33 32 00 00 00 00 00 00  ·°Exit.L32°°°°°°
0330: 01 01 02 00 53 74 61 72 74 00 00 00 00 00 00 00  ···°Start°°°°°°°
0340: 01 00 00 00 02 00 00 00 00 00 04 00 00 00 00 00  ·°°°·°°°°°·°°°°°
0350: 00 00 00 00 01 01 02 00 0E 00 00 00 57 72 69 74  °°°°···°·°°°Writ
0360: 65 2E 4C 33 32 00 74 39 32 38 33 2E 57 42 45 2F  e.L32°t9283.WBE/
0370: 20 20 20 20 20 20 30 20 20 20 20 20 20 20 20 20  ¯¯¯¯¯¯0¯¯¯¯¯¯¯¯¯
0380: 20 20 30 20 20 20 20 20 30 20 20 20 20 20 31 30  ¯¯0¯¯¯¯¯0¯¯¯¯¯10
0390: 30 36 36 36 20 20 36 30 39 20 20 20 20 20 20 20  0666¯¯609¯¯¯¯¯¯¯
03A0: 60 0A 4C 01 03 00 00 00 00 00 0E 01 00 00 10 00  `¬L··°°°°°··°°·°
03B0: 00 00 00 00 00 01 2E 74 65 78 74 00 00 00 00 00  °°°°°·.text°°°°°
03C0: 00 00 00 00 00 00 55 00 00 00 8C 00 00 00 E2 00  °°°°°°U°°°¤°°°¤°
03D0: 00 00 00 00 00 00 03 00 00 00 20 00 50 60 2E 72  °°°°°°·°°°¯°P`.r
03E0: 6F 64 61 74 61 00 00 00 00 00 00 00 00 00 0D 00  odata°°°°°°°°°·°
03F0: 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00  °°°·°°°°°°°°°°°°
0400: 00 00 40 00 50 40 2E 62 73 73 00 00 00 00 00 00  °°@°P@.bss°°°°°°
0410: 00 00 00 00 00 00 07 00 00 00 00 00 00 00 00 00  °°°°°°·°°°°°°°°°
0420: 00 00 00 00 00 00 00 00 00 00 80 00 50 C0 31 C9  °°°°°°°°°°¤°P¤1¤
0430: 31 C0 89 F7 F7 D1 F2 AE F7 D1 B8 04 00 00 00 BB  1¤¤¤¤¤¤¤¤¤¤·°°°¤
0440: 01 00 00 00 89 CA 89 F1 CD 80 C3 8D 35 02 00 00  ·°°°¤¤¤¤¤¤¤¤5·°°
0450: 00 E8 D8 FF FF FF 8D 35 00 00 00 00 E8 CD FF FF  °¤¤¤¤¤¤5°°°°¤¤¤¤
0460: FF C3 8D 35 00 00 00 00 C7 06 45 6E 64 00 C7 46  ¤¤¤5°°°°¤·End°¤F
0470: 03 0A 00 00 00 E8 B4 FF FF FF 31 DB B8 01 00 00  ·¬°°°¤¤¤¤¤1¤¤·°°
0480: 00 CD 80 00 1F 00 00 00 04 00 00 00 06 00 2A 00  °¤¤°·°°°·°°°·°*°
0490: 00 00 04 00 00 00 06 00 36 00 00 00 02 00 00 00  °°·°°°·°6°°°·°°°
04A0: 06 00 07 00 42 65 65 70 69 6E 67 2E 2E 2E 00 00  ·°·°Beeping...°°
04B0: 2E 66 69 6C 65 00 00 00 00 00 00 00 FE FF 00 00  .file°°°°°°°¤¤°°
04C0: 67 01 74 39 32 38 33 2E 68 74 6D 00 00 00 00 00  g·t9283.htm°°°°°
04D0: 00 00 00 00 2E 62 73 73 00 00 00 00 00 00 00 00  °°°°.bss°°°°°°°°
04E0: 03 00 00 00 03 01 00 00 00 00 00 00 00 00 00 00  ·°°°··°°°°°°°°°°
04F0: 00 00 00 00 00 00 00 00 2E 72 6F 64 61 74 61 00  °°°°°°°°.rodata°
0500: 00 00 00 00 02 00 00 00 03 01 0D 00 00 00 00 00  °°°°·°°°···°°°°°
0510: 00 00 00 00 00 00 00 00 00 00 00 00 2E 74 65 78  °°°°°°°°°°°°.tex
0520: 74 00 00 00 00 00 00 00 01 00 00 00 03 01 55 00  t°°°°°°°·°°°··U°
0530: 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00  °°·°°°°°°°°°°°°°
0540: 00 00 00 00 04 00 00 00 02 00 00 00 02 00 01 01  °°°°·°°°·°°°·°··
0550: 03 00 00 00 00 00 13 00 00 00 00 00 00 00 02 00  ·°°°°°·°°°°°°°·°
0560: 01 01 03 00 40 4C 54 31 00 00 00 00 02 00 00 00  ···°@LT1°°°°·°°°
0570: 02 00 01 01 03 00 40 4C 54 32 00 00 00 00 00 00  ·°···°@LT2°°°°°°
0580: 00 00 02 00 01 01 03 00 00 00 00 00 1E 00 00 00  °°·°···°°°°°·°°°
0590: 00 00 00 00 03 00 01 01 03 00 42 65 65 70 2E 4C  °°°°·°···°Beep.L
05A0: 33 32 1D 00 00 00 01 00 01 02 02 00 45 78 69 74  32·°°°·°···°Exit
05B0: 2E 4C 33 32 34 00 00 00 01 00 01 02 02 00 00 00  .L324°°°·°···°°°
05C0: 00 00 29 00 00 00 00 00 00 00 01 00 01 02 02 00  °°)°°°°°°°·°···°
05D0: 33 00 00 00 3D 42 22 42 65 65 70 69 6E 67 2E 2E  3°°°=B"Beeping..
05E0: 2E 22 00 3D 57 28 30 78 30 30 30 37 29 00 45 78  ."°=W(0x0007)°Ex
05F0: 69 74 2E 4C 33 32 2E 4D 00 57 72 69 74 65 2E 4C  it.L32.M°Write.L
0600: 33 32 00                                         32°

▲Back to the top▲