EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t8676: LIBOMF import library for 64bit Windows links DLL library


Source & expected listing t8676.htm.lst
| | EUROASM AUTOSEGMENT=ON,CPU=X64,DUMPWIDTH=28 |7438363736 |%test %SET t8676 | |;; | |;; Create auxilliary DLL library. | |%test PROGRAM FORMAT=DLL,WIDTH=64,MODEL=FLAT,ICONFILE= |[.text] ::::Section changed. |00000000: |Write.W64: PROC ; Write ASCIIZ string RSI in 64bit Windows. | | IMPORT GetStdHandle:,WriteFile: ; Declare 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:31C9 | XOR ECX,ECX ; Clear RCX to keep the size of input string. |0000001F:31C0 | XOR EAX,EAX ; Clear AL, the searched terminating character. |00000021:48F7D1 | NOT RCX ; Assume unlimited possible string size. |00000024:F2AE | REPNE SCASB ; Find the zero terminator. |00000026:48F7D1 | NOT RCX ; Get string size to RCX. |00000029:4889442420 | MOV [RSP+20h],RAX ; %5 Overlapped I/O is not used. |0000002E:4C8D4C2418 | LEA R9,[RSP+18h] ; %4 Local variable for the number of written bytes uses shadowed R9. |00000033:4989C8 | MOV R8,RCX ; %3 String size. |00000036:4889F2 | MOV RDX,RSI ; %2 String address. |00000039:4889D9 | MOV RCX,RBX ; %1 Standard output file handle. |0000003C:E8(00000000) | CALL WriteFile: ; Fastcall the imported function with 5 arguments. |00000041:4889EC | MOV RSP,RBP ; Restore the stack. |00000044:C3 | RET ; Return to caller. |00000045: |ENDPROC Write.W64: | |;; |00000045: |Beep.W64: PROC ; Play a sound in 64bit Windows. |00000045:488D35(00000000) | LEA RSI,[=B"Beeping..."] ; Define a literal string in [.rodata]. |0000004C:E8AFFFFFFF | CALL Write.W64:: ; Display the notification "Beeping...". | | IMPORT Beep: ; Declare imported Windows kernel function. |00000051:4889E5 | MOV RBP,RSP ; Save (perhaps unaligned) stack pointer. |00000054:4883E4F0 | AND RSP,-16 ; OWORD alignment downwards. |00000058:4883EC20 | SUB RSP,4*8 ; Allocate shadow space on stack. |0000005C:BAC8000000 | MOV RDX,200 ; %2 Sound duration [ms]. |00000061:B9B8010000 | MOV RCX,440 ; %1 Sound frequency [Hz]. |00000066:E8(00000000) | CALL Beep: ; Fastcall the imported function with 2 arguments. |0000006B:BA90010000 | MOV RDX,400 ; %2 Sound duration [ms]. |00000070:B94B020000 | MOV RCX,587 ; %1 Sound frequency [Hz]. |00000075:E8(00000000) | CALL Beep: ; Fastcall the imported function with 2 arguments. |0000007A:4889EC | MOV RSP,RBP ; Restore the stack. |0000007D:C3 | RET ; Return to caller. |0000007E: |ENDPROC Beep.W64: | |;; |0000007E: |Exit.W64: PROC ; Terminate program in 64bit Windows. |0000007E:488D35(00000000) | LEA RSI,[.M:] ; Address in segment [.bss] for the message. |00000085:C706456E6400 | MOVD [RSI+0],"End" ; Dynamically define the message "End". |0000008B:C746030D0A0000 | MOVD [RSI+3],0x0A0D ; CR+LF. |00000092:E869FFFFFF | CALL Write.W64:: ; Display the notification "End". | | IMPORT ExitProcess ; Declare imported Windows kernel function. |00000097:4883E4F0 | AND RSP,-16 ; OWORD alignment downwards. |0000009B:4883EC20 | SUB RSP,4*8 ; Allocate shadow space on stack. |0000009F:31C9 | XOR ECX,ECX ; %1 Terminate with errorlevel 0. |000000A1:E9(00000000) | JMP ExitProcess: ; Use imported function with 1 argument. No return. |[.bss] ::::Section changed. |00000000:.............. |.M: DB 7*BYTE ; Reserve space for ASCIIZ string "End" in segment [.bss]. |[.text] ::::Section changed. |000000A6: |ENDPROC Exit.W64: | |;; | | EXPORT Write.W64,Beep.W64,Exit.W64 |[@LT1] ====ListLiterals in section [@LT1]. |00000000:42656570696E672E~=B"Beeping..." | |ENDPROGRAM %test | **** ListMap "t8676.dll",model=FLAT,groups=0,segments=6,entry=,stack= | [.text],FA=00000400h,VA=10001000h,size=000000A6h=166,width=64,align=0010h,purpose=CODE | [.rodata],FA=00000600h,VA=10002000h,size=0000000Bh=11,width=64,align=0010h,purpose=RODATA+LITERAL | [.bss],FA=00000800h,VA=10003000h,size=00000007h=7,width=64,align=0010h,purpose=BSS | [.idata],FA=00000800h,VA=10004000h,size=000000D3h=211,width=64,align=8,purpose=IMPORT+IAT | [.edata],FA=00000A00h,VA=10005000h,size=0000006Ch=108,width=0,align=8,purpose=EXPORT | [.reloc],FA=00000C00h,VA=10006000h,size=00000010h=16,width=32,align=4,purpose=BASERELOC | **** ListGlobals "t8676.dll",Global=0,Public=0,Extern=0,eXport=3,Import=4 | Beep,[.idata]:000000C5h,VA=100040C5h,scope='I',lib="kernel32.dll" | Beep.W64,[.text]:00000045h,VA=10001045h,scope='X' | Exit.W64,[.text]:0000007Eh,VA=1000107Eh,scope='X' | ExitProcess,[.idata]:000000CCh,VA=100040CCh,scope='I',lib="kernel32.dll" | GetStdHandle,[.idata]:000000B7h,VA=100040B7h,scope='I',lib="kernel32.dll" | Write.W64,[.text]:00000000h,VA=10001000h,scope='X' | WriteFile,[.idata]:000000BEh,VA=100040BEh,scope='I',lib="kernel32.dll" | |;; | |;; Create the main LIBOMF import library. | |%test PROGRAM FORMAT=LIBOMF | | GLOBAL Write.W64,Beep.W64,Exit.W64 | | LINK %test.dll | |ENDPROGRAM %test |# I0561 Linking DLL library ".\t8676.dll". | **** ListMap "t8676.lib",model=SMALL,groups=0,segments=0,entry=,stack= | **** ListGlobals "t8676.lib",Global=0,Public=0,Extern=3,eXport=0,Import=0 | Beep.W64,[Beep.W64]:00000000h,scope='E' | Exit.W64,[Exit.W64]:00000000h,scope='E' | Write.W64,[Write.W64]:00000000h,scope='E'
Expected messages t8676.out
I0180 Assembling source file "t8676.htm". I0270 Assembling source "t8676". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t8676". "t8676.htm"{45} I0510 Assembling program pass 1. "t8676.htm"{45} I0510 Assembling program pass 2. "t8676.htm"{45} I0530 Assembling program pass 3 - final. "t8676.htm"{45} I0660 64bit FLAT DLL file "t8676.dll" created, size=3088. "t8676.htm"{106} I0650 Program "t8676" assembled in 3 passes with errorlevel 0. "t8676.htm"{106} I0470 Assembling program "t8676". "t8676.htm"{124} I0510 Assembling program pass 1. "t8676.htm"{124} I0510 Assembling program pass 2. "t8676.htm"{124} I0530 Assembling program pass 3 - final. "t8676.htm"{124} I0561 Linking DLL library ".\t8676.dll". "t8676.htm"{127} I0660 16bit SMALL LIBOMF file "t8676.lib" created, size=1536. "t8676.htm"{127} I0650 Program "t8676" assembled in 3 passes with errorlevel 0. "t8676.htm"{127} I0750 Source "t8676" (259 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t8676.htm.lst" created, size=7370. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t8676. lib
0000: F0 0D 00 00 02 00 00 02 00 01 00 00 00 00 00 00  ¤·°°·°°·°·°°°°°°
0010: 82 0A 00 08 42 65 65 70 2E 57 36 34 01 88 10 00  ¤¬°·Beep.W64·¤·°
0020: 00 00 45 75 72 6F 41 73 73 65 6D 62 6C 65 72 2F  °°EuroAssembler/
0030: 88 05 00 00 9D 37 73 2C 88 21 00 80 A0 01 00 08  ¤·°°¤7s,¤!°¤¤·°·
0040: 42 65 65 70 2E 57 36 34 09 74 38 36 37 36 2E 64  Beep.W64·t8676.d
0050: 6C 6C 08 42 65 65 70 2E 57 36 34 8E 96 02 00 00  ll·Beep.W64¤¤·°°
0060: 68 8C 0B 00 08 42 65 65 70 2E 57 36 34 00 F6 8A  h¤·°·Beep.W64°¤¤
0070: 0E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 68  ·°°°°°°°°°°°°°°h
0080: 82 0A 00 08 45 78 69 74 2E 57 36 34 E3 88 10 00  ¤¬°·Exit.W64¤¤·°
0090: 00 00 45 75 72 6F 41 73 73 65 6D 62 6C 65 72 2F  °°EuroAssembler/
00A0: 88 05 00 00 9D 37 73 2C 88 21 00 80 A0 01 00 08  ¤·°°¤7s,¤!°¤¤·°·
00B0: 45 78 69 74 2E 57 36 34 09 74 38 36 37 36 2E 64  Exit.W64·t8676.d
00C0: 6C 6C 08 45 78 69 74 2E 57 36 34 52 96 02 00 00  ll·Exit.W64R¤·°°
00D0: 68 8C 0B 00 08 45 78 69 74 2E 57 36 34 00 D8 8A  h¤·°·Exit.W64°¤¤
00E0: 0E 00 00 00 00 00 00 00 00 00 00 00 00 00 00 68  ·°°°°°°°°°°°°°°h
00F0: 82 0B 00 09 57 72 69 74 65 2E 57 36 34 70 88 10  ¤·°·Write.W64p¤·
0100: 00 00 00 45 75 72 6F 41 73 73 65 6D 62 6C 65 72  °°°EuroAssembler
0110: 2F 88 05 00 00 9D 37 73 2C 88 23 00 80 A0 01 00  /¤·°°¤7s,¤#°¤¤·°
0120: 09 57 72 69 74 65 2E 57 36 34 09 74 38 36 37 36  ·Write.W64·t8676
0130: 2E 64 6C 6C 09 57 72 69 74 65 2E 57 36 34 6C 96  .dll·Write.W64l¤
0140: 02 00 00 68 8C 0C 00 09 57 72 69 74 65 2E 57 36  ·°°h¤·°·Write.W6
0150: 34 00 65 8A 0A 00 00 00 00 00 00 00 00 00 00 6C  4°e¤¬°°°°°°°°°°l
0160: F1 9D 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ¤¤°°°°°°°°°°°°°°
0170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
01A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
01B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
01C0: 00 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: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
01F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 72  °°°°°°°°°°°°°°°r
0200: 00 00 00 00 00 00 00 00 00 00 00 00 13 00 00 00  °°°°°°°°°°°°·°°°
0210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0220: 00 00 00 00 00 19 09 57 72 69 74 65 2E 57 36 34  °°°°°··Write.W64
0230: 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ·°°°°°°°°°°°°°°°
0240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0270: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
02A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
02B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
02C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
02D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
02E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
02F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
03A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
03B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
03C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
03D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
03E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
03F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0400: 00 00 00 00 00 00 13 00 00 19 00 00 00 00 00 00  °°°°°°·°°·°°°°°°
0410: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0420: 00 00 00 00 00 1F 08 42 65 65 70 2E 57 36 34 01  °°°°°··Beep.W64·
0430: 00 00 08 45 78 69 74 2E 57 36 34 08 00 00 00 00  °°·Exit.W64·°°°°
0440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
04A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
04B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
04C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
04D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
04E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
04F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
05A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
05B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
05C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
05D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
05E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
05F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°

▲Back to the top▲