EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t8675: LIBOMF import library for 32bit Windows from DLL library


Source & expected listing t8675.htm.lst
| | EUROASM AUTOSEGMENT=ON,CPU=386,DUMPWIDTH=25 |7438363735 |%test %SET t8675 | |;; | |;; Create the auxilliary DLL library. | |%test PROGRAM FORMAT=DLL,MODEL=FLAT,WIDTH=32,ICONFILE= |[.text] ::::Section changed. |00000000: |Write.W32:: PROC ; Display ASCIIZ string pointed to by ESI using Windows. | | IMPORT GetStdHandle:,WriteFile: ; Declare imported Windows kernel functions. |00000000:6AF5 | PUSH -11 ; %1 Identifier of standard output STD_OUTPUT_HANDLE. |00000002:E8(00000000) | CALL GetStdHandle: ; Stdcall the imported Windows function with 1 argument. |00000007:89C3 | MOV EBX,EAX ; Save the returned StdOutput handle to EBX. |00000009:89F7 | MOV EDI,ESI ; Use EDI to find the end of input string. |0000000B:31C9 | XOR ECX,ECX ; Clear ECX to keep the size of input string. |0000000D:31C0 | XOR EAX,EAX ; Clear AL, the searched NUL character. |0000000F:F7D1 | NOT ECX ; Assume unlimited possible string size. |00000011:F2AE | REPNE SCASB ; Find the zero terminator. |00000013:F7D1 | NOT ECX ; Get string size to ECX. |00000015:52 | PUSH EDX ; Alloc temporary DWORD memory variable on stack. |00000016:89E2 | MOV EDX,ESP ; Get address of this DWORD to EDX. |00000018:50 | PUSH EAX ; %5 No overlap of WriteFile. |00000019:52 | PUSH EDX ; %4 Memory variable for number of bytes. |0000001A:51 | PUSH ECX ; %3 String size. |0000001B:56 | PUSH ESI ; %2 String address. |0000001C:53 | PUSH EBX ; %1 Standard output file handle. |0000001D:E8(00000000) | CALL WriteFile: ; Stdcall the imported function with 5 arguments. |00000022:5A | POP EDX ; Free and discard the temporary DWORD on stack. |00000023:C3 | RET ; Return to caller. |00000024: | ENDPROC Write.W32: | |;; |00000024: |Beep.W32:: PROC ; Play a sound in 32bit Windows. |00000024:BE[00000000] | MOV ESI,=B"Beeping..." ; Define a literal string in [.rodata]. |00000029:E8D2FFFFFF | CALL Write.W32:: ; Display the notification "Beeping...". | | IMPORT Beep: ; Declare imported Windows kernel function. |0000002E:68C8000000 | PUSH 200 ; %2 Sound duration [ms]. |00000033:68B8010000 | PUSH 440 ; %1 Sound frequency [Hz]. |00000038:E8(00000000) | CALL Beep: ; Stdcall the imported function with 2 arguments. |0000003D:6890010000 | PUSH 400 ; %2 Sound duration [ms]. |00000042:684B020000 | PUSH 587 ; %1 Sound frequency [Hz]. |00000047:E8(00000000) | CALL Beep: ; Stdcall the imported function with 2 arguments. |0000004C:C3 | RET ; Return to caller. |0000004D: | ENDPROC Beep.W32: | |;; |0000004D: |Exit.W32:: PROC ; Display the message "End" and terminate the program. |0000004D:BE[00000000] | MOV ESI,.M: ; Address in segment [.bss] for the message. |00000052:C706456E6400 | MOVD [ESI+0],"End" ; Dynamically define the message "End". |00000058:C746030D0A0000| MOVD [ESI+3],0x0A0D ; CR+LF. |0000005F:E89CFFFFFF | CALL Write.W32:: ; Display the notification "End". | | IMPORT ExitProcess: ; Use imported Windows kernel function. |00000064:6A00 | PUSH 0 ; %1 Terminate with errorlevel 0. |00000066:E9(00000000) | JMP ExitProcess: ; Use imported function with 1 argument. |[.bss] ::::Section changed. |00000000:..............|.M: DB 7*BYTE ; Reserve space for ASCIIZ string "End" in segment [.bss]. |[.text] ::::Section changed. |0000006B: | ENDPROC Exit.W32: | |;; | | EXPORT Write.W32,Beep.W32,Exit.W32 |[@LT1] ====ListLiterals in section [@LT1]. |00000000:42656570696E~~=B"Beeping..." | |ENDPROGRAM %test | **** ListMap "t8675.dll",model=FLAT,groups=0,segments=6,entry=,stack= | [.text],FA=00000400h,VA=10001000h,size=0000006Bh=107,width=32,align=0010h,purpose=CODE | [.rodata],FA=00000600h,VA=10002000h,size=0000000Bh=11,width=32,align=0010h,purpose=RODATA+LITERAL | [.bss],FA=00000800h,VA=10003000h,size=00000007h=7,width=32,align=0010h,purpose=BSS | [.idata],FA=00000800h,VA=10004000h,size=000000ABh=171,width=32,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=0000001Ch=28,width=32,align=4,purpose=BASERELOC | **** ListGlobals "t8675.dll",Global=0,Public=0,Extern=0,eXport=3,Import=4 | Beep,[.idata]:0000009Dh,VA=1000409Dh,scope='I',lib="kernel32.dll" | Beep.W32,[.text]:00000024h,VA=10001024h,scope='X' | Exit.W32,[.text]:0000004Dh,VA=1000104Dh,scope='X' | ExitProcess,[.idata]:000000A4h,VA=100040A4h,scope='I',lib="kernel32.dll" | GetStdHandle,[.idata]:0000008Fh,VA=1000408Fh,scope='I',lib="kernel32.dll" | Write.W32,[.text]:00000000h,VA=10001000h,scope='X' | WriteFile,[.idata]:00000096h,VA=10004096h,scope='I',lib="kernel32.dll" | |;; | |;; Create the main LIBOMF import library. | |%test PROGRAM FORMAT=LIBOMF | | IMPORT Write.W32,Beep.W32,Exit.W32, lib=%test.dll | | ENDPROGRAM %test | **** ListMap "t8675.lib",model=SMALL,groups=0,segments=0,entry=,stack= | **** ListGlobals "t8675.lib",Global=0,Public=0,Extern=0,eXport=0,Import=3 | Beep.W32,[Beep.W32]:00000000h,scope='I',lib="t8675.dll" | Exit.W32,[Exit.W32]:00000000h,scope='I',lib="t8675.dll" | Write.W32,[Write.W32]:00000000h,scope='I',lib="t8675.dll"
Expected messages t8675.out
I0180 Assembling source file "t8675.htm". I0270 Assembling source "t8675". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t8675". "t8675.htm"{45} I0510 Assembling program pass 1. "t8675.htm"{45} I0510 Assembling program pass 2. "t8675.htm"{45} I0530 Assembling program pass 3 - final. "t8675.htm"{45} I0660 32bit FLAT DLL file "t8675.dll" created, size=3100. "t8675.htm"{99} I0650 Program "t8675" assembled in 3 passes with errorlevel 0. "t8675.htm"{99} I0470 Assembling program "t8675". "t8675.htm"{117} I0510 Assembling program pass 1. "t8675.htm"{117} I0510 Assembling program pass 2. "t8675.htm"{117} I0530 Assembling program pass 3 - final. "t8675.htm"{117} I0660 16bit SMALL LIBOMF file "t8675.lib" created, size=1536. "t8675.htm"{119} I0650 Program "t8675" assembled in 3 passes with errorlevel 0. "t8675.htm"{119} I0750 Source "t8675" (249 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t8675.htm.lst" created, size=6452. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t8675. lib
0000: F0 0D 00 00 02 00 00 02 00 01 00 00 00 00 00 00  ¤·°°·°°·°·°°°°°°
0010: 82 07 00 05 74 38 36 37 35 24 88 10 00 00 00 45  ¤·°·t8675$¤·°°°E
0020: 75 72 6F 41 73 73 65 6D 62 6C 65 72 2F 88 05 00  uroAssembler/¤·°
0030: 00 9D 33 73 30 88 23 00 80 A0 01 00 09 57 72 69  °¤3s0¤#°¤¤·°·Wri
0040: 74 65 2E 57 33 32 09 74 38 36 37 35 2E 64 6C 6C  te.W32·t8675.dll
0050: 09 57 72 69 74 65 2E 57 33 32 77 88 21 00 80 A0  ·Write.W32w¤!°¤¤
0060: 01 00 08 42 65 65 70 2E 57 33 32 09 74 38 36 37  ·°·Beep.W32·t867
0070: 35 2E 64 6C 6C 08 42 65 65 70 2E 57 33 32 99 88  5.dll·Beep.W32¤¤
0080: 21 00 80 A0 01 00 08 45 78 69 74 2E 57 33 32 09  !°¤¤·°·Exit.W32·
0090: 74 38 36 37 35 2E 64 6C 6C 08 45 78 69 74 2E 57  t8675.dll·Exit.W
00A0: 33 32 5D 96 02 00 00 68 8C 0C 00 09 57 72 69 74  32]¤·°°h¤·°·Writ
00B0: 65 2E 57 33 32 00 6A 8C 0B 00 08 42 65 65 70 2E  e.W32°j¤·°·Beep.
00C0: 57 33 32 00 FB 8C 0B 00 08 45 78 69 74 2E 57 33  W32°¤¤·°·Exit.W3
00D0: 32 00 DD 8A 0A 00 00 00 00 00 00 00 00 00 00 6C  2°¤¤¬°°°°°°°°°°l
00E0: F1 1D 01 00 00 00 00 00 00 00 00 00 00 00 00 00  ¤··°°°°°°°°°°°°°
00F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0160: 00 00 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 F1  °°°°°°°°°°°°°°°¤
0200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0210: 00 00 00 00 00 00 00 00 00 13 00 00 19 00 00 00  °°°°°°°°°·°°·°°°
0220: 00 00 00 00 00 1F 08 42 65 65 70 2E 57 33 32 01  °°°°°··Beep.W32·
0230: 00 00 08 45 78 69 74 2E 57 33 32 01 00 00 00 00  °°·Exit.W32·°°°°
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 00 00 00 00 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 13 00 19 09 57 72 69 74 65 2E 57 33 32  °°°·°··Write.W32
0430: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ·°°°°°°°°°°°°°°°
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▲