EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t7337: Compile LIBCOF 32bit Win linking COFF 32bit Win


Description
Test creates linkable 32bit LIBCOF file t7337.lib from linkable 32bit COFF module.
See also
LinkerCombinations  
Tested procedures
PflibcofCompile   PfcoffLoadPgm  
Source & expected listing t7337.htm.lst
| | EUROASM DEBUG=OFF,PROFILE=OFF,AUTOSEGMENT=ON,LIST=ON, \ | | DUMP=ON,DUMPWIDTH=25,DUMPALL=OFF,CPU=386 | |;; | |t7337CW PROGRAM FORMAT=COFF,MODEL=FLAT,WIDTH=32, \ | | LISTMAP=ON,LISTGLOBALS=ON | | PUBLIC Write.W32 |[.text] ::::Section changed. |00000000: |Write.W32: 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 Write.W32: | |ENDPROGRAM t7337CW | **** ListMap "t7337CW.obj",groups=0,segments=2,entry=,stack= | [.text],RVA=00000000h,size=00000024h=36,width=32,align=0010h,purpose=CODE | [.drectve],RVA=00000000h,size=00000027h=39,width=0,align=0,purpose=DRECTVE | **** ListGlobals "t7337CW.obj",Global=0,Public=1,Extern=0,eXport=0,Import=2 | GetStdHandle,[GetStdHandle]:00000000h,scope='I',lib="kernel32.dll" | Write.W32,[.text]:00000000h,scope='P' | WriteFile,[WriteFile]:00000000h,scope='I',lib="kernel32.dll" | |;; | |t7337CB PROGRAM FORMAT=COFF,MODEL=FLAT,WIDTH=32, \ | | LISTMAP=ON,LISTGLOBALS=ON | | PUBLIC Beep.W32 |[.text] ::::Section changed. |00000000: |Beep.W32: PROC ; Play a sound in 32bit Windows. | | IMPORT Beep: ; Use imported Windows kernel function. |00000000:68C8000000 | PUSH 200 ; %2 Sound duration [ms]. |00000005:68B8010000 | PUSH 440 ; %1 Sound frequency [Hz]. |0000000A:E8(00000000) | CALL Beep: ; Stdcall the imported function with 2 arguments. |0000000F:6890010000 | PUSH 400 ; %2 Sound duration [ms]. |00000014:684B020000 | PUSH 587 ; %1 Sound frequency [Hz]. |00000019:E8(00000000) | CALL Beep: ; Stdcall the imported function with 2 arguments. |0000001E:C3 | RET ; Return to caller. |0000001F: | ENDPROC Beep.W32: | |ENDPROGRAM t7337CB | **** ListMap "t7337CB.obj",groups=0,segments=2,entry=,stack= | [.text],RVA=00000000h,size=0000001Fh=31,width=32,align=0010h,purpose=CODE | [.drectve],RVA=00000000h,size=0000000Dh=13,width=0,align=0,purpose=DRECTVE | **** ListGlobals "t7337CB.obj",Global=0,Public=1,Extern=0,eXport=0,Import=1 | Beep,[Beep]:00000000h,scope='I',lib="kernel32.dll" | Beep.W32,[.text]:00000000h,scope='P' | |;; | |t7337CE PROGRAM FORMAT=COFF,MODEL=FLAT,WIDTH=32, \ | | LISTMAP=ON,LISTGLOBALS=ON | | PUBLIC Exit.W32 |[.text] ::::Section changed. |00000000: |Exit.W32: PROC ; Terminate program in 32bit Windows. | | IMPORT ExitProcess: ; Use imported Windows kernel function. |00000000:6A00 | PUSH 0 ; %1 Terminate with errorlevel 0. |00000002:E9(00000000) | JMP ExitProcess: ; Use imported function with 1 argument. |00000007: | ENDPROC Exit.W32: | |ENDPROGRAM t7337CE | **** ListMap "t7337CE.obj",groups=0,segments=2,entry=,stack= | [.text],RVA=00000000h,size=00000007h=7,width=32,align=0010h,purpose=CODE | [.drectve],RVA=00000000h,size=00000014h=20,width=0,align=0,purpose=DRECTVE | **** ListGlobals "t7337CE.obj",Global=0,Public=1,Extern=0,eXport=0,Import=1 | Exit.W32,[.text]:00000000h,scope='P' | ExitProcess,[ExitProcess]:00000000h,scope='I',lib="kernel32.dll" | |;; | |t7337 PROGRAM FORMAT=LIBCOF,MODEL=FLAT,WIDTH=32, \ | | LISTMAP=OFF,LISTGLOBALS=OFF | | LINK t7337CW.obj, t7337CB.obj, t7337CE.obj | |ENDPROGRAM t7337 |# I0560 Linking COFF module ".\t7337CW.obj". |# I0563 Accepting link directive '/IMPORT:GetStdHandle'. |# I0563 Accepting link directive '/IMPORT:WriteFile'. |# I0560 Linking COFF module ".\t7337CB.obj". |# I0563 Accepting link directive '/IMPORT:Beep'. |# I0560 Linking COFF module ".\t7337CE.obj". |# I0563 Accepting link directive '/IMPORT:ExitProcess'.
Expected messages t7337.out
I0180 Assembling source file "t7337.htm". I0270 Assembling source "t7337". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t7337CW". "t7337.htm"{62} I0510 Assembling program pass 1. "t7337.htm"{62} I0510 Assembling program pass 2. "t7337.htm"{62} I0530 Assembling program pass 3 - final. "t7337.htm"{62} I0660 32bit FLAT COFF file "t7337CW.obj" created, size=395. "t7337.htm"{88} I0650 Program "t7337CW" assembled in 3 passes with errorlevel 0. "t7337.htm"{88} I0470 Assembling program "t7337CB". "t7337.htm"{97} I0510 Assembling program pass 1. "t7337.htm"{97} I0510 Assembling program pass 2. "t7337.htm"{97} I0530 Assembling program pass 3 - final. "t7337.htm"{97} I0660 32bit FLAT COFF file "t7337CB.obj" created, size=314. "t7337.htm"{111} I0650 Program "t7337CB" assembled in 3 passes with errorlevel 0. "t7337.htm"{111} I0470 Assembling program "t7337CE". "t7337.htm"{119} I0510 Assembling program pass 1. "t7337.htm"{119} I0510 Assembling program pass 2. "t7337.htm"{119} I0530 Assembling program pass 3 - final. "t7337.htm"{119} I0660 32bit FLAT COFF file "t7337CE.obj" created, size=298. "t7337.htm"{128} I0650 Program "t7337CE" assembled in 3 passes with errorlevel 0. "t7337.htm"{128} I0470 Assembling program "t7337". "t7337.htm"{136} I0510 Assembling program pass 1. "t7337.htm"{136} I0530 Assembling program pass 2 - final. "t7337.htm"{136} I0560 Linking COFF module ".\t7337CW.obj". "t7337.htm"{139} I0563 Accepting link directive '/IMPORT:GetStdHandle'. "t7337.htm"{139} I0563 Accepting link directive '/IMPORT:WriteFile'. "t7337.htm"{139} I0560 Linking COFF module ".\t7337CB.obj". "t7337.htm"{139} I0563 Accepting link directive '/IMPORT:Beep'. "t7337.htm"{139} I0560 Linking COFF module ".\t7337CE.obj". "t7337.htm"{139} I0563 Accepting link directive '/IMPORT:ExitProcess'. "t7337.htm"{139} I0660 32bit FLAT LIBCOF file "t7337.lib" created, size=1708. "t7337.htm"{139} I0650 Program "t7337" assembled in 2 passes with errorlevel 0. "t7337.htm"{139} I0750 Source "t7337" (300 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t7337.htm.lst" created, size=6201. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t7337. 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 98 00 00 02 02  ¯¯`¬°°°·°°·¤°°··
0050: 00 00 02 6A 00 00 03 BE 00 00 04 20 00 00 05 3C  °°·j°°·¤°°·¯°°·<
0060: 00 00 05 A6 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 57 72 69 74 65  °WriteFile°Write
0080: 2E 57 33 32 00 42 65 65 70 00 42 65 65 70 2E 57  .W32°Beep°Beep.W
0090: 33 32 00 45 78 69 74 50 72 6F 63 65 73 73 00 45  32°ExitProcess°E
00A0: 78 69 74 2E 57 33 32 00 2F 20 20 20 20 20 20 20  xit.W32°/¯¯¯¯¯¯¯
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 38 20 20 20 20 20  100666¯¯118¯¯¯¯¯
00E0: 20 20 60 0A 07 00 00 00 98 01 00 00 02 02 00 00  ¯¯`¬·°°°¤·°°··°°
00F0: 6A 02 00 00 BE 03 00 00 20 04 00 00 3C 05 00 00  j·°°¤·°°¯·°°<·°°
0100: A6 05 00 00 07 00 00 00 04 00 05 00 07 00 06 00  ¤·°°·°°°·°·°·°·°
0110: 01 00 03 00 02 00 42 65 65 70 00 42 65 65 70 2E  ·°·°·°Beep°Beep.
0120: 57 33 32 00 45 78 69 74 2E 57 33 32 00 45 78 69  W32°Exit.W32°Exi
0130: 74 50 72 6F 63 65 73 73 00 47 65 74 53 74 64 48  tProcess°GetStdH
0140: 61 6E 64 6C 65 00 57 72 69 74 65 2E 57 33 32 00  andle°Write.W32°
0150: 57 72 69 74 65 46 69 6C 65 00 2F 2F 20 20 20 20  WriteFile°//¯¯¯¯
0160: 20 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20  ¯¯¯¯¯¯¯¯¯¯0¯¯¯¯¯
0170: 20 20 20 20 20 20 30 20 20 20 20 20 30 20 20 20  ¯¯¯¯¯¯0¯¯¯¯¯0¯¯¯
0180: 20 20 31 30 30 36 36 36 20 20 32 20 20 20 20 20  ¯¯100666¯¯2¯¯¯¯¯
0190: 20 20 20 20 60 0A 00 0A 47 65 74 53 74 64 48 61  ¯¯¯¯`¬°¬GetStdHa
01A0: 6E 64 6C 65 2F 20 20 20 30 20 20 20 20 20 20 20  ndle/¯¯¯0¯¯¯¯¯¯¯
01B0: 20 20 20 20 30 20 20 20 20 20 30 20 20 20 20 20  ¯¯¯¯0¯¯¯¯¯0¯¯¯¯¯
01C0: 31 30 30 36 36 36 20 20 34 36 20 20 20 20 20 20  100666¯¯46¯¯¯¯¯¯
01D0: 20 20 60 0A 00 00 FF FF 00 00 4C 01 00 00 00 00  ¯¯`¬°°¤¤°°L·°°°°
01E0: 1A 00 00 00 00 00 04 00 47 65 74 53 74 64 48 61  ·°°°°°·°GetStdHa
01F0: 6E 64 6C 65 00 6B 65 72 6E 65 6C 33 32 2E 64 6C  ndle°kernel32.dl
0200: 6C 00 57 72 69 74 65 46 69 6C 65 2F 20 20 20 20  l°WriteFile/¯¯¯¯
0210: 20 20 30 20 20 20 20 20 20 20 20 20 20 20 30 20  ¯¯0¯¯¯¯¯¯¯¯¯¯¯0¯
0220: 20 20 20 20 30 20 20 20 20 20 31 30 30 36 36 36  ¯¯¯¯0¯¯¯¯¯100666
0230: 20 20 34 33 20 20 20 20 20 20 20 20 60 0A 00 00  ¯¯43¯¯¯¯¯¯¯¯`¬°°
0240: FF FF 00 00 4C 01 00 00 00 00 17 00 00 00 00 00  ¤¤°°L·°°°°·°°°°°
0250: 04 00 57 72 69 74 65 46 69 6C 65 00 6B 65 72 6E  ·°WriteFile°kern
0260: 65 6C 33 32 2E 64 6C 6C 00 10 74 37 33 33 37 43  el32.dll°·t7337C
0270: 57 2F 20 20 20 20 20 20 20 20 30 20 20 20 20 20  W/¯¯¯¯¯¯¯¯0¯¯¯¯¯
0280: 20 20 20 20 20 20 30 20 20 20 20 20 30 20 20 20  ¯¯¯¯¯¯0¯¯¯¯¯0¯¯¯
0290: 20 20 31 30 30 36 36 36 20 20 32 37 39 20 20 20  ¯¯100666¯¯279¯¯¯
02A0: 20 20 20 20 60 0A 4C 01 01 00 00 00 00 00 74 00  ¯¯¯¯`¬L··°°°°°t°
02B0: 00 00 07 00 00 00 00 00 00 01 2E 74 65 78 74 00  °°·°°°°°°·.text°
02C0: 00 00 00 00 00 00 00 00 00 00 24 00 00 00 3C 00  °°°°°°°°°°$°°°<°
02D0: 00 00 60 00 00 00 00 00 00 00 02 00 00 00 20 00  °°`°°°°°°°·°°°¯°
02E0: 50 60 6A F5 E8 00 00 00 00 89 C3 89 F7 31 C9 31  P`j¤¤°°°°¤¤¤¤1¤1
02F0: C0 F7 D1 F2 AE F7 D1 52 89 E2 50 52 51 56 53 E8  ¤¤¤¤¤¤¤R¤¤PRQVS¤
0300: 00 00 00 00 5A C3 03 00 00 00 05 00 00 00 14 00  °°°°Z¤·°°°·°°°·°
0310: 1E 00 00 00 06 00 00 00 14 00 2E 66 69 6C 65 00  ·°°°·°°°·°.file°
0320: 00 00 00 00 00 00 FE FF 00 00 67 01 74 37 33 33  °°°°°°¤¤°°g·t733
0330: 37 2E 68 74 6D 00 00 00 00 00 00 00 00 00 2E 74  7.htm°°°°°°°°°.t
0340: 65 78 74 00 00 00 00 00 00 00 01 00 00 00 03 01  ext°°°°°°°·°°°··
0350: 24 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00  $°°°·°°°°°°°°°°°
0360: 00 00 00 00 00 00 04 00 00 00 00 00 00 00 01 00  °°°°°°·°°°°°°°·°
0370: 01 02 02 00 00 00 00 00 0E 00 00 00 00 00 00 00  ···°°°°°·°°°°°°°
0380: 00 00 01 01 02 00 00 00 00 00 1B 00 00 00 00 00  °°···°°°°°·°°°°°
0390: 00 00 00 00 01 01 02 00 25 00 00 00 57 72 69 74  °°°°···°%°°°Writ
03A0: 65 2E 57 33 32 00 47 65 74 53 74 64 48 61 6E 64  e.W32°GetStdHand
03B0: 6C 65 00 57 72 69 74 65 46 69 6C 65 00 10 42 65  le°WriteFile°·Be
03C0: 65 70 2F 20 20 20 20 20 20 20 20 20 20 20 30 20  ep/¯¯¯¯¯¯¯¯¯¯¯0¯
03D0: 20 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20  ¯¯¯¯¯¯¯¯¯¯0¯¯¯¯¯
03E0: 30 20 20 20 20 20 31 30 30 36 36 36 20 20 33 38  0¯¯¯¯¯100666¯¯38
03F0: 20 20 20 20 20 20 20 20 60 0A 00 00 FF FF 00 00  ¯¯¯¯¯¯¯¯`¬°°¤¤°°
0400: 4C 01 00 00 00 00 12 00 00 00 00 00 04 00 42 65  L·°°°°·°°°°°·°Be
0410: 65 70 00 6B 65 72 6E 65 6C 33 32 2E 64 6C 6C 00  ep°kernel32.dll°
0420: 74 37 33 33 37 43 42 2F 20 20 20 20 20 20 20 20  t7337CB/¯¯¯¯¯¯¯¯
0430: 30 20 20 20 20 20 20 20 20 20 20 20 30 20 20 20  0¯¯¯¯¯¯¯¯¯¯¯0¯¯¯
0440: 20 20 30 20 20 20 20 20 31 30 30 36 36 36 20 20  ¯¯0¯¯¯¯¯100666¯¯
0450: 32 32 34 20 20 20 20 20 20 20 60 0A 4C 01 01 00  224¯¯¯¯¯¯¯`¬L··°
0460: 00 00 00 00 70 00 00 00 06 00 00 00 00 00 00 01  °°°°p°°°·°°°°°°·
0470: 2E 74 65 78 74 00 00 00 00 00 00 00 00 00 00 00  .text°°°°°°°°°°°
0480: 1F 00 00 00 3C 00 00 00 5C 00 00 00 00 00 00 00  ·°°°<°°°\°°°°°°°
0490: 02 00 00 00 20 00 50 60 68 C8 00 00 00 68 B8 01  ·°°°¯°P`h¤°°°h¤·
04A0: 00 00 E8 00 00 00 00 68 90 01 00 00 68 4B 02 00  °°¤°°°°h¤·°°hK·°
04B0: 00 E8 00 00 00 00 C3 00 0B 00 00 00 05 00 00 00  °¤°°°°¤°·°°°·°°°
04C0: 14 00 1A 00 00 00 05 00 00 00 14 00 2E 66 69 6C  ·°·°°°·°°°·°.fil
04D0: 65 00 00 00 00 00 00 00 FE FF 00 00 67 01 74 37  e°°°°°°°¤¤°°g·t7
04E0: 33 33 37 2E 68 74 6D 00 00 00 00 00 00 00 00 00  337.htm°°°°°°°°°
04F0: 2E 74 65 78 74 00 00 00 00 00 00 00 01 00 00 00  .text°°°°°°°·°°°
0500: 03 01 1F 00 00 00 02 00 00 00 00 00 00 00 00 00  ···°°°·°°°°°°°°°
0510: 00 00 00 00 42 65 65 70 2E 57 33 32 00 00 00 00  °°°°Beep.W32°°°°
0520: 01 00 01 02 02 00 42 65 65 70 00 00 00 00 00 00  ·°···°Beep°°°°°°
0530: 00 00 00 00 01 01 02 00 04 00 00 00 45 78 69 74  °°°°···°·°°°Exit
0540: 50 72 6F 63 65 73 73 2F 20 20 20 20 30 20 20 20  Process/¯¯¯¯0¯¯¯
0550: 20 20 20 20 20 20 20 20 30 20 20 20 20 20 30 20  ¯¯¯¯¯¯¯¯0¯¯¯¯¯0¯
0560: 20 20 20 20 31 30 30 36 36 36 20 20 34 35 20 20  ¯¯¯¯100666¯¯45¯¯
0570: 20 20 20 20 20 20 60 0A 00 00 FF FF 00 00 4C 01  ¯¯¯¯¯¯`¬°°¤¤°°L·
0580: 00 00 00 00 19 00 00 00 00 00 04 00 45 78 69 74  °°°°·°°°°°·°Exit
0590: 50 72 6F 63 65 73 73 00 6B 65 72 6E 65 6C 33 32  Process°kernel32
05A0: 2E 64 6C 6C 00 10 74 37 33 33 37 43 45 2F 20 20  .dll°·t7337CE/¯¯
05B0: 20 20 20 20 20 20 30 20 20 20 20 20 20 20 20 20  ¯¯¯¯¯¯0¯¯¯¯¯¯¯¯¯
05C0: 20 20 30 20 20 20 20 20 30 20 20 20 20 20 31 30  ¯¯0¯¯¯¯¯0¯¯¯¯¯10
05D0: 30 36 36 36 20 20 32 30 32 20 20 20 20 20 20 20  0666¯¯202¯¯¯¯¯¯¯
05E0: 60 0A 4C 01 01 00 00 00 00 00 4E 00 00 00 06 00  `¬L··°°°°°N°°°·°
05F0: 00 00 00 00 00 01 2E 74 65 78 74 00 00 00 00 00  °°°°°·.text°°°°°
0600: 00 00 00 00 00 00 07 00 00 00 3C 00 00 00 44 00  °°°°°°·°°°<°°°D°
0610: 00 00 00 00 00 00 01 00 00 00 20 00 50 60 6A 00  °°°°°°·°°°¯°P`j°
0620: E9 00 00 00 00 00 03 00 00 00 05 00 00 00 14 00  ¤°°°°°·°°°·°°°·°
0630: 2E 66 69 6C 65 00 00 00 00 00 00 00 FE FF 00 00  .file°°°°°°°¤¤°°
0640: 67 01 74 37 33 33 37 2E 68 74 6D 00 00 00 00 00  g·t7337.htm°°°°°
0650: 00 00 00 00 2E 74 65 78 74 00 00 00 00 00 00 00  °°°°.text°°°°°°°
0660: 01 00 00 00 03 01 07 00 00 00 01 00 00 00 00 00  ·°°°···°°°·°°°°°
0670: 00 00 00 00 00 00 00 00 45 78 69 74 2E 57 33 32  °°°°°°°°Exit.W32
0680: 00 00 00 00 01 00 01 02 02 00 00 00 00 00 04 00  °°°°·°···°°°°°·°
0690: 00 00 00 00 00 00 00 00 01 01 02 00 10 00 00 00  °°°°°°°°···°·°°°
06A0: 45 78 69 74 50 72 6F 63 65 73 73 00              ExitProcess°

▲Back to the top▲