EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t7349: Compile LIBCOF 64bit Win


Description
Test creates linkable 64bit LIBCOF file t7349.lib.
See also
LinkerCombinations  
Tested procedures
PflibcofCompile  
Source & expected listing t7349.htm.lst
| | EUROASM DEBUG=OFF,PROFILE=OFF,AUTOSEGMENT=ON,LIST=ON, \ | | DUMP=ON,DUMPWIDTH=25,DUMPALL=OFF,CPU=X64,AMD=YES | |;; | |t7349 PROGRAM FORMAT=LIBCOF,MODEL=FLAT,WIDTH=64, \ | | LISTMAP=OFF,LISTGLOBALS=OFF | | PUBLIC Write.W64, Beep.W64, Exit.W64 |[.text] ::::Section changed. |00000000: |Write.W64: PROC ; Write ASCIIZ string DS:RSI in 64bit Windows. | | IMPORT GetStdHandle:,WriteFile: ; Use imported Windows kernel functions. |00000000:4889E5 | MOV RBP,RSP ; Save (perhaps unaligned) stack pointer. |00000003:4883E4F0 | AND RSP,-16 ; OWORD alignment downwards. |00000007:4883EC30 | SUB RSP,5*8+8 ; Allocate shadow space on stack for max 5 arguments. |0000000B:48C7C1F5FFFFFF| MOV RCX,-11 ; %1 Identifier of standard output STD_OUTPUT_HANDLE. |00000012:E8(00000000) | CALL GetStdHandle: ; Fastcall the imported Windows function with 1 argument. |00000017:4889C3 | MOV RBX,RAX ; Temporary save the returned StdOutput handle to RBX. |0000001A:4889F7 | MOV RDI,RSI ; Use RDI to find the end of input string. |0000001D:4831C9 | XOR RCX,RCX ; Use RCX to keep the size of input string. |00000020:4831C0 | XOR RAX,RAX ; Zero AL, the searched terminating character. |00000023:48F7D1 | NOT RCX ; Assume unlimited possible string size. |00000026:F2AE | REPNE SCASB ; Find the zero terminator. |00000028:48F7D1 | NOT RCX ; Get string size to RCX. |0000002B:89442420 | MOV [RSP+20h],EAX ; %5 Overlapped I/O is not used. |0000002F:4C8D4C2418 | LEA R9,[RSP+18h] ; %4 Local variable for the number of written bytes uses shadowed R9. |00000034:4989C8 | MOV R8,RCX ; %3 String size. |00000037:4889F2 | MOV RDX,RSI ; %2 String address. |0000003A:4889D9 | MOV RCX,RBX ; %1 Standard output file handle. |0000003D:E8(00000000) | CALL WriteFile: ; Fastcall the imported function with 5 arguments. |00000042:4889EC | MOV RSP,RBP ; Restore the stack. |00000045:C3 | RET ; Return to caller. |00000046: | ENDPROC Write.W64: |00000046: |Beep.W64: PROC ; Play a sound in 64bit Windows. | | IMPORT Beep: ; Use imported Windows kernel function. |00000046:4889E5 | MOV RBP,RSP ; Save (perhaps unaligned) stack pointer. |00000049:4883E4F0 | AND RSP,-16 ; OWORD alignment downwards. |0000004D:4883EC28 | SUB RSP,4*8+8 ; Allocate shadow space on stack. |00000051:BAC8000000 | MOV RDX,200 ; %2 Sound duration [ms]. |00000056:B9B8010000 | MOV RCX,440 ; %1 Sound frequency [Hz]. |0000005B:E8(00000000) | CALL Beep: ; Fastcall the imported function with 2 arguments. |00000060:BA90010000 | MOV RDX,400 ; %2 Sound duration [ms]. |00000065:B94B020000 | MOV RCX,587 ; %1 Sound frequency [Hz]. |0000006A:E8(00000000) | CALL Beep: ; Fastcall the imported function with 2 arguments. |0000006F:4889EC | MOV RSP,RBP ; Restore the stack. |00000072:C3 | RET ; Return to caller. |00000073: | ENDPROC Beep.W64: |00000073: |Exit.W64: PROC ; Terminate program in 64bit Windows. | | IMPORT ExitProcess ; Use imported Windows kernel function. |00000073:4883E4F0 | AND RSP,-16 ; OWORD alignment downwards. |00000077:4883EC28 | SUB RSP,4*8+8 ; Allocate shadow space on stack. |0000007B:4829C9 | SUB RCX,RCX ; %1 Terminate with errorlevel 0. |0000007E:E9(00000000) | JMP ExitProcess: ; Use imported function with 1 argument. No return. |00000083: | ENDPROC Exit.W64: | |ENDPROGRAM t7349
Expected messages t7349.out
I0180 Assembling source file "t7349.htm". I0270 Assembling source "t7349". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t7349". "t7349.htm"{59} I0510 Assembling program pass 1. "t7349.htm"{59} I0510 Assembling program pass 2. "t7349.htm"{59} I0530 Assembling program pass 3 - final. "t7349.htm"{59} I0660 64bit FLAT LIBCOF file "t7349.lib" created, size=1363. "t7349.htm"{107} I0650 Program "t7349" assembled in 3 passes with errorlevel 0. "t7349.htm"{107} I0750 Source "t7349" (216 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t7349.htm.lst" created, size=4146. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t7349. 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 30 20 20 20 20 20  100666¯¯100¯¯¯¯¯
0040: 20 20 60 0A 00 00 00 07 00 00 01 90 00 00 01 FA  ¯¯`¬°°°·°°·¤°°·¤
0050: 00 00 02 62 00 00 02 C4 00 00 03 2E 00 00 03 2E  °°·b°°·¤°°·.°°·.
0060: 00 00 03 2E 47 65 74 53 74 64 48 61 6E 64 6C 65  °°·.GetStdHandle
0070: 00 57 72 69 74 65 46 69 6C 65 00 42 65 65 70 00  °WriteFile°Beep°
0080: 45 78 69 74 50 72 6F 63 65 73 73 00 57 72 69 74  ExitProcess°Writ
0090: 65 2E 57 36 34 00 42 65 65 70 2E 57 36 34 00 45  e.W64°Beep.W64°E
00A0: 78 69 74 2E 57 36 34 00 2F 20 20 20 20 20 20 20  xit.W64°/¯¯¯¯¯¯¯
00B0: 20 20 20 20 20 20 20 20 30 20 20 20 20 20 20 20  ¯¯¯¯¯¯¯¯0¯¯¯¯¯¯¯
00C0: 20 20 20 20 30 20 20 20 20 20 30 20 20 20 20 20  ¯¯¯¯0¯¯¯¯¯0¯¯¯¯¯
00D0: 31 30 30 36 36 36 20 20 31 31 30 20 20 20 20 20  100666¯¯110¯¯¯¯¯
00E0: 20 20 60 0A 05 00 00 00 90 01 00 00 FA 01 00 00  ¯¯`¬·°°°¤·°°¤·°°
00F0: 62 02 00 00 C4 02 00 00 2E 03 00 00 07 00 00 00  b·°°¤·°°.·°°·°°°
0100: 03 00 05 00 05 00 04 00 01 00 05 00 02 00 42 65  ·°·°·°·°·°·°·°Be
0110: 65 70 00 42 65 65 70 2E 57 36 34 00 45 78 69 74  ep°Beep.W64°Exit
0120: 2E 57 36 34 00 45 78 69 74 50 72 6F 63 65 73 73  .W64°ExitProcess
0130: 00 47 65 74 53 74 64 48 61 6E 64 6C 65 00 57 72  °GetStdHandle°Wr
0140: 69 74 65 2E 57 36 34 00 57 72 69 74 65 46 69 6C  ite.W64°WriteFil
0150: 65 00 2F 2F 20 20 20 20 20 20 20 20 20 20 20 20  e°//¯¯¯¯¯¯¯¯¯¯¯¯
0160: 20 20 30 20 20 20 20 20 20 20 20 20 20 20 30 20  ¯¯0¯¯¯¯¯¯¯¯¯¯¯0¯
0170: 20 20 20 20 30 20 20 20 20 20 31 30 30 36 36 36  ¯¯¯¯0¯¯¯¯¯100666
0180: 20 20 32 20 20 20 20 20 20 20 20 20 60 0A 00 0A  ¯¯2¯¯¯¯¯¯¯¯¯`¬°¬
0190: 47 65 74 53 74 64 48 61 6E 64 6C 65 2F 20 20 20  GetStdHandle/¯¯¯
01A0: 30 20 20 20 20 20 20 20 20 20 20 20 30 20 20 20  0¯¯¯¯¯¯¯¯¯¯¯0¯¯¯
01B0: 20 20 30 20 20 20 20 20 31 30 30 36 36 36 20 20  ¯¯0¯¯¯¯¯100666¯¯
01C0: 34 36 20 20 20 20 20 20 20 20 60 0A 00 00 FF FF  46¯¯¯¯¯¯¯¯`¬°°¤¤
01D0: 01 00 64 86 00 00 00 00 1A 00 00 00 00 00 04 00  ·°d¤°°°°·°°°°°·°
01E0: 47 65 74 53 74 64 48 61 6E 64 6C 65 00 6B 65 72  GetStdHandle°ker
01F0: 6E 65 6C 33 32 2E 64 6C 6C 00 57 72 69 74 65 46  nel32.dll°WriteF
0200: 69 6C 65 2F 20 20 20 20 20 20 30 20 20 20 20 20  ile/¯¯¯¯¯¯0¯¯¯¯¯
0210: 20 20 20 20 20 20 30 20 20 20 20 20 30 20 20 20  ¯¯¯¯¯¯0¯¯¯¯¯0¯¯¯
0220: 20 20 31 30 30 36 36 36 20 20 34 33 20 20 20 20  ¯¯100666¯¯43¯¯¯¯
0230: 20 20 20 20 60 0A 00 00 FF FF 01 00 64 86 00 00  ¯¯¯¯`¬°°¤¤·°d¤°°
0240: 00 00 17 00 00 00 00 00 04 00 57 72 69 74 65 46  °°·°°°°°·°WriteF
0250: 69 6C 65 00 6B 65 72 6E 65 6C 33 32 2E 64 6C 6C  ile°kernel32.dll
0260: 00 10 42 65 65 70 2F 20 20 20 20 20 20 20 20 20  °·Beep/¯¯¯¯¯¯¯¯¯
0270: 20 20 30 20 20 20 20 20 20 20 20 20 20 20 30 20  ¯¯0¯¯¯¯¯¯¯¯¯¯¯0¯
0280: 20 20 20 20 30 20 20 20 20 20 31 30 30 36 36 36  ¯¯¯¯0¯¯¯¯¯100666
0290: 20 20 33 38 20 20 20 20 20 20 20 20 60 0A 00 00  ¯¯38¯¯¯¯¯¯¯¯`¬°°
02A0: FF FF 01 00 64 86 00 00 00 00 12 00 00 00 00 00  ¤¤·°d¤°°°°·°°°°°
02B0: 04 00 42 65 65 70 00 6B 65 72 6E 65 6C 33 32 2E  ·°Beep°kernel32.
02C0: 64 6C 6C 00 45 78 69 74 50 72 6F 63 65 73 73 2F  dll°ExitProcess/
02D0: 20 20 20 20 30 20 20 20 20 20 20 20 20 20 20 20  ¯¯¯¯0¯¯¯¯¯¯¯¯¯¯¯
02E0: 30 20 20 20 20 20 30 20 20 20 20 20 31 30 30 36  0¯¯¯¯¯0¯¯¯¯¯1006
02F0: 36 36 20 20 34 35 20 20 20 20 20 20 20 20 60 0A  66¯¯45¯¯¯¯¯¯¯¯`¬
0300: 00 00 FF FF 01 00 64 86 00 00 00 00 19 00 00 00  °°¤¤·°d¤°°°°·°°°
0310: 00 00 04 00 45 78 69 74 50 72 6F 63 65 73 73 00  °°·°ExitProcess°
0320: 6B 65 72 6E 65 6C 33 32 2E 64 6C 6C 00 10 74 37  kernel32.dll°·t7
0330: 33 34 39 2F 20 20 20 20 20 20 20 20 20 20 30 20  349/¯¯¯¯¯¯¯¯¯¯0¯
0340: 20 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20  ¯¯¯¯¯¯¯¯¯¯0¯¯¯¯¯
0350: 30 20 20 20 20 20 31 30 30 36 36 36 20 20 34 38  0¯¯¯¯¯100666¯¯48
0360: 39 20 20 20 20 20 20 20 60 0A 64 86 01 00 00 00  9¯¯¯¯¯¯¯`¬d¤·°°°
0370: 00 00 F2 00 00 00 0B 00 00 00 00 00 20 00 2E 74  °°¤°°°·°°°°°¯°.t
0380: 65 78 74 00 00 00 00 00 00 00 00 00 00 00 83 00  ext°°°°°°°°°°°¤°
0390: 00 00 3C 00 00 00 C0 00 00 00 00 00 00 00 05 00  °°<°°°¤°°°°°°°·°
03A0: 00 00 20 00 50 60 48 89 E5 48 83 E4 F0 48 83 EC  °°¯°P`H¤¤H¤¤¤H¤¤
03B0: 30 48 C7 C1 F5 FF FF FF E8 00 00 00 00 48 89 C3  0H¤¤¤¤¤¤¤°°°°H¤¤
03C0: 48 89 F7 48 31 C9 48 31 C0 48 F7 D1 F2 AE 48 F7  H¤¤H1¤H1¤H¤¤¤¤H¤
03D0: D1 89 44 24 20 4C 8D 4C 24 18 49 89 C8 48 89 F2  ¤¤D$¯L¤L$·I¤¤H¤¤
03E0: 48 89 D9 E8 00 00 00 00 48 89 EC C3 48 89 E5 48  H¤¤¤°°°°H¤¤¤H¤¤H
03F0: 83 E4 F0 48 83 EC 28 BA C8 00 00 00 B9 B8 01 00  ¤¤¤H¤¤(¤¤°°°¤¤·°
0400: 00 E8 00 00 00 00 BA 90 01 00 00 B9 4B 02 00 00  °¤°°°°¤¤·°°¤K·°°
0410: E8 00 00 00 00 48 89 EC C3 48 83 E4 F0 48 83 EC  ¤°°°°H¤¤¤H¤¤¤H¤¤
0420: 28 48 29 C9 E9 00 00 00 00 00 13 00 00 00 07 00  (H)¤¤°°°°°·°°°·°
0430: 00 00 04 00 3E 00 00 00 08 00 00 00 04 00 5C 00  °°·°>°°°·°°°·°\°
0440: 00 00 09 00 00 00 04 00 6B 00 00 00 09 00 00 00  °°·°°°·°k°°°·°°°
0450: 04 00 7F 00 00 00 0A 00 00 00 04 00 2E 66 69 6C  ·°¤°°°¬°°°·°.fil
0460: 65 00 00 00 00 00 00 00 FE FF 00 00 67 01 74 37  e°°°°°°°¤¤°°g·t7
0470: 33 34 39 2E 68 74 6D 00 00 00 00 00 00 00 00 00  349.htm°°°°°°°°°
0480: 2E 74 65 78 74 00 00 00 00 00 00 00 01 00 00 00  .text°°°°°°°·°°°
0490: 03 01 83 00 00 00 05 00 00 00 00 00 00 00 00 00  ··¤°°°·°°°°°°°°°
04A0: 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00  °°°°°°°°·°°°°°°°
04B0: 01 00 01 02 02 00 42 65 65 70 2E 57 36 34 46 00  ·°···°Beep.W64F°
04C0: 00 00 01 00 01 02 02 00 45 78 69 74 2E 57 36 34  °°·°···°Exit.W64
04D0: 73 00 00 00 01 00 01 02 02 00 00 00 00 00 0E 00  s°°°·°···°°°°°·°
04E0: 00 00 00 00 00 00 00 00 01 01 02 00 00 00 00 00  °°°°°°°°···°°°°°
04F0: 1B 00 00 00 00 00 00 00 00 00 01 01 02 00 42 65  ·°°°°°°°°°···°Be
0500: 65 70 00 00 00 00 00 00 00 00 00 00 01 01 02 00  ep°°°°°°°°°°···°
0510: 00 00 00 00 25 00 00 00 00 00 00 00 00 00 01 01  °°°°%°°°°°°°°°··
0520: 02 00 31 00 00 00 57 72 69 74 65 2E 57 36 34 00  ·°1°°°Write.W64°
0530: 47 65 74 53 74 64 48 61 6E 64 6C 65 00 57 72 69  GetStdHandle°Wri
0540: 74 65 46 69 6C 65 00 45 78 69 74 50 72 6F 63 65  teFile°ExitProce
0550: 73 73 00                                         ss°

▲Back to the top▲