EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t7583: Compile DLL 32bit Win linking DLL 32bit Win


Description
Test creates 32bit proxy DLL file t7583.dll with exports forwarded to another library t7583F.dll.
See also
LinkerCombinations  
Tested procedures
PfdllCompile   PfdllLoadPgm  
Source & expected listing t7583.htm.lst
| | EUROASM DEBUG=OFF,PROFILE=OFF,AUTOSEGMENT=ON,LIST=ON, \ | | DUMP=ON,DUMPWIDTH=25,DUMPALL=OFF,CPU=386 | |;; | |t7583F PROGRAM FORMAT=DLL,MODEL=FLAT,WIDTH=32, \ | | ICONFILE=,LISTMAP=ON,LISTGLOBALS=ON | | EXPORT WriteW32, BeepW32, ExitW32 |[.text] ::::Section changed. |00000000: |WriteW32: PROC ; Write ASCIIZ string DS:ESI in 32bit Windows. | | IMPORT GetStdHandle:,WriteFile: ; Use 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 ; Use ECX to keep the size of input string. |0000000D:31C0 | XOR EAX,EAX ; Zero AL, the searched 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 DWORD room 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 room on stack. |00000023:C3 | RET ; Return to caller. |00000024: | ENDPROC WriteW32: |00000024: |BeepW32: PROC ; Play a sound in 32bit Windows. | | IMPORT Beep: ; Use imported Windows kernel function. |00000024:68C8000000 | PUSH 200 ; %2 Sound duration [ms]. |00000029:68B8010000 | PUSH 440 ; %1 Sound frequency [Hz]. |0000002E:E8(00000000) | CALL Beep: ; Stdcall the imported function with 2 arguments. |00000033:6890010000 | PUSH 400 ; %2 Sound duration [ms]. |00000038:684B020000 | PUSH 587 ; %1 Sound frequency [Hz]. |0000003D:E8(00000000) | CALL Beep: ; Stdcall the imported function with 2 arguments. |00000042:C3 | RET ; Return to caller. |00000043: | ENDPROC BeepW32: |00000043: |ExitW32: PROC ; Terminate program in 32bit Windows. | | IMPORT ExitProcess: ; Use imported Windows kernel function. |00000043:6A00 | PUSH 0 ; %1 Terminate with errorlevel 0. |00000045:E9(00000000) | JMP ExitProcess: ; Use imported function with 1 argument. |0000004A: | ENDPROC ExitW32: | |ENDPROGRAM t7583F | **** ListMap "t7583F.dll",groups=0,segments=4,entry=,stack= | [.text],VA=10001000h,size=0000004Ah=74,width=32,align=1000h,purpose=CODE | [.idata],VA=10002000h,size=000000ABh=171,width=32,align=8,purpose=IMPORT+IAT | [.edata],VA=10003000h,size=0000006Ah=106,width=0,align=8,purpose=EXPORT | [.reloc],VA=10004000h,size=00000010h=16,width=32,align=4,purpose=BASERELOC | **** ListGlobals "t7583F.dll",Global=0,Public=0,Extern=0,eXport=3,Import=4 | Beep,[.idata]:0000009Dh,VA=1000209Dh,scope='I',lib="kernel32.dll" | BeepW32,[.text]:00000024h,VA=10001024h,scope='X' | ExitProcess,[.idata]:000000A4h,VA=100020A4h,scope='I',lib="kernel32.dll" | ExitW32,[.text]:00000043h,VA=10001043h,scope='X' | GetStdHandle,[.idata]:0000008Fh,VA=1000208Fh,scope='I',lib="kernel32.dll" | WriteFile,[.idata]:00000096h,VA=10002096h,scope='I',lib="kernel32.dll" | WriteW32,[.text]:00000000h,VA=10001000h,scope='X' | |;; | |t7583 PROGRAM FORMAT=DLL,MODEL=FLAT,WIDTH=32, \ | | ICONFILE=,LISTMAP=ON,LISTGLOBALS=ON | | EXPORT Write.W32,LIB=t7583F.dll, FWD=WriteW32 | | EXPORT Beep.W32, LIB=t7583F.dll, FWD=BeepW32 | | EXPORT Exit.W32, LIB=t7583F.dll, FWD=ExitW32 | |ENDPROGRAM t7583 | **** ListMap "t7583.dll",groups=0,segments=1,entry=,stack= | [.edata],VA=10001000h,size=0000009Ah=154,width=0,align=8,purpose=EXPORT | **** ListGlobals "t7583.dll",Global=0,Public=0,Extern=0,eXport=3,Import=0 | Beep.W32,scope='X',lib="t7583F.dll",fwd=BeepW32 | Exit.W32,scope='X',lib="t7583F.dll",fwd=ExitW32 | Write.W32,scope='X',lib="t7583F.dll",fwd=WriteW32
Expected messages t7583.out
I0180 Assembling source file "t7583.htm". I0270 Assembling source "t7583". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t7583F". "t7583.htm"{62} I0510 Assembling program pass 1. "t7583.htm"{62} I0510 Assembling program pass 2. "t7583.htm"{62} I0530 Assembling program pass 3 - final. "t7583.htm"{62} I0660 32bit FLAT DLL file "t7583F.dll" created, size=2576. "t7583.htm"{103} I0650 Program "t7583F" assembled in 3 passes with errorlevel 0. "t7583.htm"{103} I0470 Assembling program "t7583". "t7583.htm"{118} I0510 Assembling program pass 1. "t7583.htm"{118} I0510 Assembling program pass 2. "t7583.htm"{118} I0530 Assembling program pass 3 - final. "t7583.htm"{118} I0660 32bit FLAT DLL file "t7583.dll" created, size=666. "t7583.htm"{123} I0650 Program "t7583" assembled in 3 passes with errorlevel 0. "t7583.htm"{123} I0750 Source "t7583" (200 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t7583.htm.lst" created, size=5393. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t7583. dll
0000: 4D 5A 89 00 01 00 00 00 04 00 21 00 FF FF 05 00  MZ¤°·°°°·°!°¤¤·°
0010: 00 02 61 8A 00 00 00 00 40 00 00 00 00 00 00 00  °·a¤°°°°@°°°°°°°
0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0030: 00 00 00 00 00 00 00 00 00 00 00 00 90 00 00 00  °°°°°°°°°°°°¤°°°
0040: 0E 1F BA 0E 00 B4 09 CD 21 B8 08 4C CD 21 54 68  ··¤·°¤·¤!¤·L¤!Th
0050: 69 73 20 70 72 6F 67 72 61 6D 20 77 61 73 20 6C  is¯program¯was¯l
0060: 61 75 6E 63 68 65 64 20 69 6E 20 44 4F 53 20 62  aunched¯in¯DOS¯b
0070: 75 74 20 69 74 20 72 65 71 75 69 72 65 73 20 57  ut¯it¯requires¯W
0080: 69 6E 64 6F 77 73 2E 24 00 00 00 00 00 00 00 00  indows.$°°°°°°°°
0090: 50 45 00 00 4C 01 01 00 00 00 00 00 00 00 00 00  PE°°L··°°°°°°°°°
00A0: 00 00 00 00 E0 00 02 21 0B 01 01 00 00 00 00 00  °°°°¤°·!···°°°°°
00B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
00C0: 00 00 00 00 00 00 00 10 00 10 00 00 00 02 00 00  °°°°°°°·°·°°°·°°
00D0: 04 00 00 00 01 00 00 00 04 00 00 00 00 00 00 00  ·°°°·°°°·°°°°°°°
00E0: 00 20 00 00 B0 01 00 00 00 00 00 00 03 00 0F 00  °¯°°¤·°°°°°°·°·°
00F0: 00 00 10 00 00 10 00 00 00 00 00 01 00 00 10 00  °°·°°·°°°°°·°°·°
0100: 00 00 00 00 10 00 00 00 00 10 00 00 9A 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 2E 65 64 61 74 61 00 00  °°°°°°°°.edata°°
0190: 00 10 00 00 00 10 00 00 9A 00 00 00 00 02 00 00  °·°°°·°°¤°°°°·°°
01A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 40  °°°°°°°°°°°°°°@@
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 00  °°°°°°°°°°°°°°°°
0200: 00 00 00 00 00 00 00 00 01 00 00 00 46 10 00 00  °°°°°°°°·°°°F·°°
0210: 01 00 00 00 03 00 00 00 03 00 00 00 28 10 00 00  ·°°°·°°°·°°°(·°°
0220: 34 10 00 00 40 10 00 00 6C 10 00 00 7B 10 00 00  4·°°@·°°l·°°{·°°
0230: 8A 10 00 00 50 10 00 00 59 10 00 00 62 10 00 00  ¤·°°P·°°Y·°°b·°°
0240: 00 00 01 00 02 00 74 37 35 38 33 2E 64 6C 6C 00  °°·°·°t7583.dll°
0250: 42 65 65 70 2E 57 33 32 00 45 78 69 74 2E 57 33  Beep.W32°Exit.W3
0260: 32 00 57 72 69 74 65 2E 57 33 32 00 74 37 35 38  2°Write.W32°t758
0270: 33 46 2E 42 65 65 70 57 33 32 00 74 37 35 38 33  3F.BeepW32°t7583
0280: 46 2E 45 78 69 74 57 33 32 00 74 37 35 38 33 46  F.ExitW32°t7583F
0290: 2E 57 72 69 74 65 57 33 32 00                    .WriteW32°

▲Back to the top▲