EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t9324: LIBCOF library for 64bit Linux links LIBCOF library


Source & expected listing t9324.htm.lst
| | EUROASM AUTOSEGMENT=ON,CPU=x64,DUMPWIDTH=28 |7439333234 |%test %SET t9324 | |;; | |;; Create the first auxiliary COFF module. | |%test.WB PROGRAM FORMAT=COFF,MODEL=FLAT,WIDTH=64 |[.text] ::::Section changed. |00000000: |Write.L64:: PROC ; Display ASCIIZ string pointed to by RSI using 64bit Linux. |00000000:31C9 | XOR ECX,ECX ; Clear RCX to keep the size of input string. |00000002:31C0 | XOR EAX,EAX ; Clear AL, the searched terminating character |00000004:4889F7 | MOV RDI,RSI ; %2 String address in RSI,RDI. |00000007:48F7D1 | NOT RCX ; Assume unlimited possible string size. |0000000A:F2AE | REPNE SCASB ; Find the zero terminator. |0000000C:48F7D1 | NOT RCX ; Get string size to RCX. |0000000F:B801000000 | MOV RAX,1 ; Kernel service sys_write. |00000014:BF01000000 | MOV RDI,1 ; %1 I/O handle STDOUT_FILENO. |00000019:89CA | MOV EDX,ECX ; %3 String size. |0000001B:0F05 | SYSCALL ; Invoke kernel. |0000001D:C3 | RET ; Return to caller. RAX,RCX,RDX,RSI,RDI,R11 are clobbered. |0000001E: | ENDPROC Write.L64: | |;; |0000001E: |Beep.L64:: PROC ; Display message "Beeping.." and play a sound using 64bit Linux. |0000001E:488D35(00000000) | LEA RSI,[=B"Beeping..."] ; Define a literal string in [.rodata]. |00000025:E8D6FFFFFF | CALL Write.L64:: ; Display the notification "Beeping...". |0000002A:488D35(00000000) | LEA RSI,[=W(0x0007)] ; Define ASCIIZ string with BEL character in [.rodata]. |00000031:E8CAFFFFFF | CALL Write.L64:: ; Play the beep sound. |00000036:C3 | RET ; Return to caller. RAX,RCX,RDX,RSI,RDI,R11 are clobbered. |00000037: | ENDPROC Beep.L64: |[@LT2] ====ListLiterals in section [@LT2]. |00000000:0700 =W(0x0007) |[@LT1] ====ListLiterals in section [@LT1]. |00000000:42656570696E672E~=B"Beeping..." | |ENDPROGRAM %test.WB | **** ListMap "t9324.WB.obj",model=FLAT,groups=0,segments=2,entry=,stack= | [.text],FA=00000064h,RVA=00000000h,size=00000037h=55,width=64,align=0010h,purpose=CODE | [.rodata],FA=000000B0h,RVA=00000000h,size=0000000Dh=13,width=64,align=0010h,purpose=RODATA+LITERAL | **** ListGlobals "t9324.WB.obj",Global=0,Public=2,Extern=0,eXport=0,Import=0 | Beep.L64,[.text]:0000001Eh,scope='P' | Write.L64,[.text]:00000000h,scope='P' | |;; | |;; Create the second auxiliary COFF module. | |%test.EX PROGRAM FORMAT=COFF,MODEL=FLAT,WIDTH=64 |[.text] ::::Section changed. |00000000: |Exit.L64:: PROC ; Display message "End", terminate the program. |00000000:488D35(00000000) | LEA RSI,[.M:] ; String "End" will be defined in segment [.bss] at RSI. |00000007:C706456E6400 | MOVD [RSI+0],"End" ; Dynamically define the message "End". |0000000D:C746030A000000 | MOVD [RSI+3],0x0A ; LF+NUL. |00000014:E8(00000000) | CALL Write.L64:: ; Display the notification "End". |00000019:31FF | XOR EDI,EDI ; %1 Errorlevel=0. |0000001B:B83C000000 | MOV RAX,60 ; Kernel service sys_exit. |00000020:0F05 | SYSCALL ; 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. |00000022: | ENDPROC Exit.L64: | |ENDPROGRAM %test.EX | **** ListMap "t9324.EX.obj",model=FLAT,groups=0,segments=2,entry=,stack= | [.text],FA=00000064h,RVA=00000000h,size=00000022h=34,width=64,align=0010h,purpose=CODE | [.bss],FA=00000000h,RVA=00000000h,size=00000007h=7,width=64,align=0010h,purpose=BSS | **** ListGlobals "t9324.EX.obj",Global=0,Public=1,Extern=1,eXport=0,Import=0 | Exit.L64,[.text]:00000000h,scope='P' | Write.L64,[Write.L64]:00000000h,scope='E' | |;; | |;; Create the auxiliary LIBCOF library. | |%test.coff PROGRAM FORMAT=LIBCOF,MODEL=FLAT,WIDTH=64 | | GLOBAL Write.L64,Beep.L64,Exit.L64 | | LINK %test.WB.obj, %test.EX.obj | | ENDPROGRAM %test.coff |# I0560 Linking COFF module ".\t9324.WB.obj". |# I0560 Linking COFF module ".\t9324.EX.obj". | **** ListMap "t9324.coff.lib",model=FLAT,groups=0,segments=0,entry=,stack= | **** ListGlobals "t9324.coff.lib",Global=0,Public=0,Extern=3,eXport=0,Import=0 | Beep.L64,[Beep.L64]:00000000h,scope='E' | Exit.L64,[Exit.L64]:00000000h,scope='E' | Write.L64,[Write.L64]:00000000h,scope='E' | |;; | |;; Create the main LIBCOF library. | |%test PROGRAM FORMAT=LIBCOF,MODEL=FLAT,WIDTH=64 | | GLOBAL Write.L64,Beep.L64,Exit.L64 | | LINK %test.coff.lib |[.data] ::::Section changed. |00000000:363462697420464C~|Msg:: DB '%^WIDTH[]bit %^MODEL %^FORMAT program "%^OUTFILE".',10,0 | | ENDPROGRAM %test |# I0561 Linking LIBCOF library ".\t9324.coff.lib". | **** ListMap "t9324.lib",model=FLAT,groups=0,segments=1,entry=,stack= | [.data],FA=0000003Ch,RVA=00000000h,size=00000028h=40,width=64,align=0010h,purpose=DATA | **** ListGlobals "t9324.lib",Global=0,Public=1,Extern=3,eXport=0,Import=0 | Beep.L64,[Beep.L64]:00000000h,scope='E' | Exit.L64,[Exit.L64]:00000000h,scope='E' | Msg,[.data]:00000000h,scope='P' | Write.L64,[Write.L64]:00000000h,scope='E'
Expected messages t9324.out
I0180 Assembling source file "t9324.htm". I0270 Assembling source "t9324". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t9324.WB". "t9324.htm"{45} I0510 Assembling program pass 1. "t9324.htm"{45} I0510 Assembling program pass 2. "t9324.htm"{45} I0530 Assembling program pass 3 - final. "t9324.htm"{45} I0660 64bit FLAT COFF file "t9324.WB.obj" created, size=446. "t9324.htm"{72} I0650 Program "t9324.WB" assembled in 3 passes with errorlevel 0. "t9324.htm"{72} I0470 Assembling program "t9324.EX". "t9324.htm"{81} I0510 Assembling program pass 1. "t9324.htm"{81} I0510 Assembling program pass 2. "t9324.htm"{81} I0530 Assembling program pass 3 - final. "t9324.htm"{81} I0660 64bit FLAT COFF file "t9324.EX.obj" created, size=341. "t9324.htm"{95} I0650 Program "t9324.EX" assembled in 3 passes with errorlevel 0. "t9324.htm"{95} I0470 Assembling program "t9324.coff". "t9324.htm"{104} I0510 Assembling program pass 1. "t9324.htm"{104} I0510 Assembling program pass 2. "t9324.htm"{104} I0530 Assembling program pass 3 - final. "t9324.htm"{104} I0560 Linking COFF module ".\t9324.WB.obj". "t9324.htm"{107} I0560 Linking COFF module ".\t9324.EX.obj". "t9324.htm"{107} I0660 64bit FLAT LIBCOF file "t9324.coff.lib" created, size=1267. "t9324.htm"{107} I0650 Program "t9324.coff" assembled in 3 passes with errorlevel 0. "t9324.htm"{107} I0470 Assembling program "t9324". "t9324.htm"{117} I0510 Assembling program pass 1. "t9324.htm"{117} I0510 Assembling program pass 2. "t9324.htm"{117} I0530 Assembling program pass 3 - final. "t9324.htm"{117} I0561 Linking LIBCOF library ".\t9324.coff.lib". "t9324.htm"{122} I0660 64bit FLAT LIBCOF file "t9324.lib" created, size=1621. "t9324.htm"{122} I0650 Program "t9324" assembled in 3 passes with errorlevel 0. "t9324.htm"{122} I0750 Source "t9324" (276 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t9324.htm.lst" created, size=6446. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t9324. 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 34 20 20 20 20 20  100666¯¯104¯¯¯¯¯
0040: 20 20 60 0A 00 00 00 09 00 00 01 8C 00 00 01 8C  ¯¯`¬°°°·°°·¤°°·¤
0050: 00 00 02 CA 00 00 02 CA 00 00 02 CA 00 00 02 CA  °°·¤°°·¤°°·¤°°·¤
0060: 00 00 04 C4 00 00 04 C4 00 00 04 C4 2E 64 61 74  °°·¤°°·¤°°·¤.dat
0070: 61 00 4D 73 67 00 2E 74 65 78 74 00 2E 72 6F 64  a°Msg°.text°.rod
0080: 61 74 61 00 42 65 65 70 2E 4C 36 34 00 57 72 69  ata°Beep.L64°Wri
0090: 74 65 2E 4C 36 34 00 2E 74 65 78 74 00 2E 62 73  te.L64°.text°.bs
00A0: 73 00 45 78 69 74 2E 4C 36 34 00 0A 2F 20 20 20  s°Exit.L64°¬/¯¯¯
00B0: 20 20 20 20 20 20 20 20 20 20 20 20 30 20 20 20  ¯¯¯¯¯¯¯¯¯¯¯¯0¯¯¯
00C0: 20 20 20 20 20 20 20 20 30 20 20 20 20 20 30 20  ¯¯¯¯¯¯¯¯0¯¯¯¯¯0¯
00D0: 20 20 20 20 31 30 30 36 36 36 20 20 31 30 32 20  ¯¯¯¯100666¯¯102¯
00E0: 20 20 20 20 20 20 60 0A 03 00 00 00 8C 01 00 00  ¯¯¯¯¯¯`¬·°°°¤·°°
00F0: CA 02 00 00 C4 04 00 00 09 00 00 00 03 00 01 00  ¤·°°¤·°°·°°°·°·°
0100: 02 00 02 00 03 00 02 00 03 00 01 00 02 00 2E 62  ·°·°·°·°·°·°·°.b
0110: 73 73 00 2E 64 61 74 61 00 2E 72 6F 64 61 74 61  ss°.data°.rodata
0120: 00 2E 74 65 78 74 00 2E 74 65 78 74 00 42 65 65  °.text°.text°Bee
0130: 70 2E 4C 36 34 00 45 78 69 74 2E 4C 36 34 00 4D  p.L64°Exit.L64°M
0140: 73 67 00 57 72 69 74 65 2E 4C 36 34 00 0A 2F 2F  sg°Write.L64°¬//
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 33 32  ¯¯¯¯¯¯¯¯`¬°¬t932
0190: 34 2F 20 20 20 20 20 20 20 20 20 20 30 20 20 20  4/¯¯¯¯¯¯¯¯¯¯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 32 35 38 20  ¯¯¯¯100666¯¯258¯
01C0: 20 20 20 20 20 20 60 0A 64 86 01 00 00 00 00 00  ¯¯¯¯¯¯`¬d¤·°°°°°
01D0: 64 00 00 00 08 00 00 00 00 00 20 00 2E 64 61 74  d°°°·°°°°°¯°.dat
01E0: 61 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00  a°°°°°°°°°°°(°°°
01F0: 3C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  <°°°°°°°°°°°°°°°
0200: 40 00 50 C0 36 34 62 69 74 20 46 4C 41 54 20 4C  @°P¤64bit¯FLAT¯L
0210: 49 42 43 4F 46 20 70 72 6F 67 72 61 6D 20 22 74  IBCOF¯program¯"t
0220: 39 33 32 34 2E 6C 69 62 22 2E 0A 00 2E 66 69 6C  9324.lib".¬°.fil
0230: 65 00 00 00 00 00 00 00 FE FF 00 00 67 01 74 39  e°°°°°°°¤¤°°g·t9
0240: 33 32 34 2E 68 74 6D 00 00 00 00 00 00 00 00 00  324.htm°°°°°°°°°
0250: 2E 64 61 74 61 00 00 00 00 00 00 00 01 00 00 00  .data°°°°°°°·°°°
0260: 03 01 28 00 00 00 00 00 00 00 00 00 00 00 00 00  ··(°°°°°°°°°°°°°
0270: 00 00 00 00 42 65 65 70 2E 4C 36 34 00 00 00 00  °°°°Beep.L64°°°°
0280: 00 00 01 01 02 00 45 78 69 74 2E 4C 36 34 00 00  °°···°Exit.L64°°
0290: 00 00 00 00 01 01 02 00 4D 73 67 00 00 00 00 00  °°°°···°Msg°°°°°
02A0: 00 00 00 00 01 00 0C 00 02 00 00 00 00 00 04 00  °°°°·°·°·°°°°°·°
02B0: 00 00 00 00 00 00 00 00 01 01 02 00 0E 00 00 00  °°°°°°°°···°·°°°
02C0: 57 72 69 74 65 2E 4C 36 34 00 74 39 33 32 34 2E  Write.L64°t9324.
02D0: 57 42 2F 20 20 20 20 20 20 20 30 20 20 20 20 20  WB/¯¯¯¯¯¯¯0¯¯¯¯¯
02E0: 20 20 20 20 20 20 30 20 20 20 20 20 30 20 20 20  ¯¯¯¯¯¯0¯¯¯¯¯0¯¯¯
02F0: 20 20 31 30 30 36 36 36 20 20 34 34 36 20 20 20  ¯¯100666¯¯446¯¯¯
0300: 20 20 20 20 60 0A 64 86 02 00 00 00 00 00 BE 00  ¯¯¯¯`¬d¤·°°°°°¤°
0310: 00 00 0C 00 00 00 00 00 20 00 2E 74 65 78 74 00  °°·°°°°°¯°.text°
0320: 00 00 00 00 00 00 00 00 00 00 37 00 00 00 64 00  °°°°°°°°°°7°°°d°
0330: 00 00 9C 00 00 00 00 00 00 00 02 00 00 00 20 00  °°¤°°°°°°°·°°°¯°
0340: 50 60 2E 72 6F 64 61 74 61 00 00 00 00 00 00 00  P`.rodata°°°°°°°
0350: 00 00 0D 00 00 00 B0 00 00 00 00 00 00 00 00 00  °°·°°°¤°°°°°°°°°
0360: 00 00 00 00 00 00 40 00 50 40 31 C9 31 C0 48 89  °°°°°°@°P@1¤1¤H¤
0370: F7 48 F7 D1 F2 AE 48 F7 D1 B8 01 00 00 00 BF 01  ¤H¤¤¤¤H¤¤¤·°°°¤·
0380: 00 00 00 89 CA 0F 05 C3 48 8D 35 02 00 00 00 E8  °°°¤¤··¤H¤5·°°°¤
0390: D6 FF FF FF 48 8D 35 00 00 00 00 E8 CA FF FF FF  ¤¤¤¤H¤5°°°°¤¤¤¤¤
03A0: C3 00 21 00 00 00 02 00 00 00 04 00 2D 00 00 00  ¤°!°°°·°°°·°-°°°
03B0: 02 00 00 00 04 00 07 00 42 65 65 70 69 6E 67 2E  ·°°°·°·°Beeping.
03C0: 2E 2E 00 00 2E 66 69 6C 65 00 00 00 00 00 00 00  ..°°.file°°°°°°°
03D0: FE FF 00 00 67 01 74 39 33 32 34 2E 68 74 6D 00  ¤¤°°g·t9324.htm°
03E0: 00 00 00 00 00 00 00 00 2E 72 6F 64 61 74 61 00  °°°°°°°°.rodata°
03F0: 00 00 00 00 02 00 00 00 03 01 0D 00 00 00 00 00  °°°°·°°°···°°°°°
0400: 00 00 00 00 00 00 00 00 00 00 00 00 2E 74 65 78  °°°°°°°°°°°°.tex
0410: 74 00 00 00 00 00 00 00 01 00 00 00 03 01 37 00  t°°°°°°°·°°°··7°
0420: 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00  °°·°°°°°°°°°°°°°
0430: 00 00 00 00 04 00 00 00 02 00 00 00 02 00 0C 00  °°°°·°°°·°°°·°·°
0440: 03 00 00 00 00 00 13 00 00 00 00 00 00 00 02 00  ·°°°°°·°°°°°°°·°
0450: 0D 00 03 00 40 4C 54 31 00 00 00 00 02 00 00 00  ·°·°@LT1°°°°·°°°
0460: 02 00 01 01 03 00 40 4C 54 32 00 00 00 00 00 00  ·°···°@LT2°°°°°°
0470: 00 00 02 00 01 01 03 00 42 65 65 70 2E 4C 36 34  °°·°···°Beep.L64
0480: 1E 00 00 00 01 00 01 02 02 00 00 00 00 00 1E 00  ·°°°·°···°°°°°·°
0490: 00 00 00 00 00 00 01 00 01 02 02 00 28 00 00 00  °°°°°°·°···°(°°°
04A0: 3D 42 22 42 65 65 70 69 6E 67 2E 2E 2E 22 00 3D  =B"Beeping..."°=
04B0: 57 28 30 78 30 30 30 37 29 00 57 72 69 74 65 2E  W(0x0007)°Write.
04C0: 4C 36 34 00 74 39 33 32 34 2E 45 58 2F 20 20 20  L64°t9324.EX/¯¯¯
04D0: 20 20 20 20 30 20 20 20 20 20 20 20 20 20 20 20  ¯¯¯¯0¯¯¯¯¯¯¯¯¯¯¯
04E0: 30 20 20 20 20 20 30 20 20 20 20 20 31 30 30 36  0¯¯¯¯¯0¯¯¯¯¯1006
04F0: 36 36 20 20 33 34 31 20 20 20 20 20 20 20 60 0A  66¯¯341¯¯¯¯¯¯¯`¬
0500: 64 86 02 00 00 00 00 00 9A 00 00 00 09 00 00 00  d¤·°°°°°¤°°°·°°°
0510: 00 00 20 00 2E 74 65 78 74 00 00 00 00 00 00 00  °°¯°.text°°°°°°°
0520: 00 00 00 00 22 00 00 00 64 00 00 00 86 00 00 00  °°°°"°°°d°°°¤°°°
0530: 00 00 00 00 02 00 00 00 20 00 50 60 2E 62 73 73  °°°°·°°°¯°P`.bss
0540: 00 00 00 00 00 00 00 00 00 00 00 00 07 00 00 00  °°°°°°°°°°°°·°°°
0550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0560: 80 00 50 C0 48 8D 35 00 00 00 00 C7 06 45 6E 64  ¤°P¤H¤5°°°°¤·End
0570: 00 C7 46 03 0A 00 00 00 E8 00 00 00 00 31 FF B8  °¤F·¬°°°¤°°°°1¤¤
0580: 3C 00 00 00 0F 05 03 00 00 00 02 00 00 00 04 00  <°°°···°°°·°°°·°
0590: 15 00 00 00 08 00 00 00 04 00 2E 66 69 6C 65 00  ·°°°·°°°·°.file°
05A0: 00 00 00 00 00 00 FE FF 00 00 67 01 74 39 33 32  °°°°°°¤¤°°g·t932
05B0: 34 2E 68 74 6D 00 00 00 00 00 00 00 00 00 2E 62  4.htm°°°°°°°°°.b
05C0: 73 73 00 00 00 00 00 00 00 00 02 00 00 00 03 01  ss°°°°°°°°·°°°··
05D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
05E0: 00 00 2E 74 65 78 74 00 00 00 00 00 00 00 01 00  °°.text°°°°°°°·°
05F0: 00 00 03 01 22 00 00 00 02 00 00 00 00 00 00 00  °°··"°°°·°°°°°°°
0600: 00 00 00 00 00 00 00 00 00 00 04 00 00 00 00 00  °°°°°°°°°°·°°°°°
0610: 00 00 02 00 0C 00 03 00 45 78 69 74 2E 4C 36 34  °°·°·°·°Exit.L64
0620: 00 00 00 00 01 00 01 02 02 00 00 00 00 00 0F 00  °°°°·°···°°°°°·°
0630: 00 00 00 00 00 00 00 00 01 01 02 00 19 00 00 00  °°°°°°°°···°·°°°
0640: 45 78 69 74 2E 4C 36 34 2E 4D 00 57 72 69 74 65  Exit.L64.M°Write
0650: 2E 4C 36 34 00                                   .L64°

▲Back to the top▲