EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t7235: Compile COFF 64bit Win


Description
Test creates linkable 64bit COFF file t7235.obj.
See also
LinkerCombinations  
Tested procedures
PfcoffCompile  
Source & expected listing t7235.htm.lst
| | EUROASM DEBUG=OFF,PROFILE=OFF,AUTOSEGMENT=ON,LIST=ON, \ | | DUMP=ON,DUMPWIDTH=25,DUMPALL=OFF,CPU=X64,AMD=YES | |;; | |t7235 PROGRAM FORMAT=COFF,MODEL=FLAT,WIDTH=64, \ | | LISTMAP=ON,LISTGLOBALS=ON | | 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 t7235 | **** ListMap "t7235.obj",groups=0,segments=2,entry=,stack= | [.text],RVA=00000000h,size=00000083h=131,width=64,align=0010h,purpose=CODE | [.drectve],RVA=00000000h,size=00000048h=72,width=0,align=0,purpose=DRECTVE | **** ListGlobals "t7235.obj",Global=0,Public=3,Extern=0,eXport=0,Import=4 | Beep,[Beep]:00000000h,scope='I',lib="kernel32.dll" | Beep.W64,[.text]:00000046h,scope='P' | Exit.W64,[.text]:00000073h,scope='P' | ExitProcess,[ExitProcess]:00000000h,scope='I',lib="kernel32.dll" | GetStdHandle,[GetStdHandle]:00000000h,scope='I',lib="kernel32.dll" | Write.W64,[.text]:00000000h,scope='P' | WriteFile,[WriteFile]:00000000h,scope='I',lib="kernel32.dll"
Expected messages t7235.out
I0180 Assembling source file "t7235.htm". I0270 Assembling source "t7235". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t7235". "t7235.htm"{59} I0510 Assembling program pass 1. "t7235.htm"{59} I0510 Assembling program pass 2. "t7235.htm"{59} I0530 Assembling program pass 3 - final. "t7235.htm"{59} I0660 64bit FLAT COFF file "t7235.obj" created, size=637. "t7235.htm"{107} I0650 Program "t7235" assembled in 3 passes with errorlevel 0. "t7235.htm"{107} I0750 Source "t7235" (181 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t7235.htm.lst" created, size=4895. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t7235. obj
0000: 64 86 02 00 00 00 00 00 62 01 00 00 0D 00 00 00  d¤·°°°°°b·°°·°°°
0010: 00 00 20 00 2E 74 65 78 74 00 00 00 00 00 00 00  °°¯°.text°°°°°°°
0020: 00 00 00 00 83 00 00 00 64 00 00 00 E8 00 00 00  °°°°¤°°°d°°°¤°°°
0030: 00 00 00 00 05 00 00 00 20 00 50 60 2E 64 72 65  °°°°·°°°¯°P`.dre
0040: 63 74 76 65 00 00 00 00 00 00 00 00 48 00 00 00  ctve°°°°°°°°H°°°
0050: 1A 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ··°°°°°°°°°°°°°°
0060: 00 0A 10 02 48 89 E5 48 83 E4 F0 48 83 EC 30 48  °¬··H¤¤H¤¤¤H¤¤0H
0070: C7 C1 F5 FF FF FF E8 00 00 00 00 48 89 C3 48 89  ¤¤¤¤¤¤¤°°°°H¤¤H¤
0080: F7 48 31 C9 48 31 C0 48 F7 D1 F2 AE 48 F7 D1 89  ¤H1¤H1¤H¤¤¤¤H¤¤¤
0090: 44 24 20 4C 8D 4C 24 18 49 89 C8 48 89 F2 48 89  D$¯L¤L$·I¤¤H¤¤H¤
00A0: D9 E8 00 00 00 00 48 89 EC C3 48 89 E5 48 83 E4  ¤¤°°°°H¤¤¤H¤¤H¤¤
00B0: F0 48 83 EC 28 BA C8 00 00 00 B9 B8 01 00 00 E8  ¤H¤¤(¤¤°°°¤¤·°°¤
00C0: 00 00 00 00 BA 90 01 00 00 B9 4B 02 00 00 E8 00  °°°°¤¤·°°¤K·°°¤°
00D0: 00 00 00 48 89 EC C3 48 83 E4 F0 48 83 EC 28 48  °°°H¤¤¤H¤¤¤H¤¤(H
00E0: 29 C9 E9 00 00 00 00 00 13 00 00 00 09 00 00 00  )¤¤°°°°°·°°°·°°°
00F0: 04 00 3E 00 00 00 0A 00 00 00 04 00 5C 00 00 00  ·°>°°°¬°°°·°\°°°
0100: 0B 00 00 00 04 00 6B 00 00 00 0B 00 00 00 04 00  ·°°°·°k°°°·°°°·°
0110: 7F 00 00 00 0C 00 00 00 04 00 20 2F 49 4D 50 4F  ¤°°°·°°°·°¯/IMPO
0120: 52 54 3A 47 65 74 53 74 64 48 61 6E 64 6C 65 20  RT:GetStdHandle¯
0130: 2F 49 4D 50 4F 52 54 3A 57 72 69 74 65 46 69 6C  /IMPORT:WriteFil
0140: 65 20 2F 49 4D 50 4F 52 54 3A 42 65 65 70 20 2F  e¯/IMPORT:Beep¯/
0150: 49 4D 50 4F 52 54 3A 45 78 69 74 50 72 6F 63 65  IMPORT:ExitProce
0160: 73 73 2E 66 69 6C 65 00 00 00 00 00 00 00 FE FF  ss.file°°°°°°°¤¤
0170: 00 00 67 01 74 37 32 33 35 2E 68 74 6D 00 00 00  °°g·t7235.htm°°°
0180: 00 00 00 00 00 00 2E 74 65 78 74 00 00 00 00 00  °°°°°°.text°°°°°
0190: 00 00 01 00 00 00 03 01 83 00 00 00 05 00 00 00  °°·°°°··¤°°°·°°°
01A0: 00 00 00 00 00 00 00 00 00 00 2E 64 72 65 63 74  °°°°°°°°°°.drect
01B0: 76 65 00 00 00 00 02 00 00 00 03 01 48 00 00 00  ve°°°°·°°°··H°°°
01C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
01D0: 00 00 04 00 00 00 00 00 00 00 01 00 01 02 02 00  °°·°°°°°°°·°···°
01E0: 42 65 65 70 2E 57 36 34 46 00 00 00 01 00 01 02  Beep.W64F°°°·°··
01F0: 02 00 45 78 69 74 2E 57 36 34 73 00 00 00 01 00  ·°Exit.W64s°°°·°
0200: 01 02 02 00 00 00 00 00 0E 00 00 00 00 00 00 00  ···°°°°°·°°°°°°°
0210: 00 00 01 01 02 00 00 00 00 00 1B 00 00 00 00 00  °°···°°°°°·°°°°°
0220: 00 00 00 00 01 01 02 00 42 65 65 70 00 00 00 00  °°°°···°Beep°°°°
0230: 00 00 00 00 00 00 01 01 02 00 00 00 00 00 25 00  °°°°°°···°°°°°%°
0240: 00 00 00 00 00 00 00 00 01 01 02 00 31 00 00 00  °°°°°°°°···°1°°°
0250: 57 72 69 74 65 2E 57 36 34 00 47 65 74 53 74 64  Write.W64°GetStd
0260: 48 61 6E 64 6C 65 00 57 72 69 74 65 46 69 6C 65  Handle°WriteFile
0270: 00 45 78 69 74 50 72 6F 63 65 73 73 00           °ExitProcess°

▲Back to the top▲