EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

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


Description
Test creates linkable 32bit COFF file t7229.obj from linkable 32bit LIBCOF module.
See also
LinkerCombinations  
Tested procedures
PfcoffCompile   PflibcofLoadPgm  
Source & expected listing t7229.htm.lst
| | EUROASM DEBUG=OFF,PROFILE=OFF,AUTOSEGMENT=ON,LIST=ON, \ | | DUMP=ON,DUMPWIDTH=25,DUMPALL=OFF,CPU=386 | |;; | |t7229CW 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 t7229CW | **** ListMap "t7229CW.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 "t7229CW.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" | |;; | |t7229CB 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 t7229CB | **** ListMap "t7229CB.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 "t7229CB.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' | |;; | |t7229CE 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 t7229CE | **** ListMap "t7229CE.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 "t7229CE.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" | |;; | |t7229C PROGRAM FORMAT=LIBCOF,MODEL=FLAT,WIDTH=32, \ | | LISTMAP=OFF,LISTGLOBALS=OFF | | LINK t7229CW.obj, t7229CB.obj, t7229CE.obj | |ENDPROGRAM t7229C |# I0560 Linking COFF module ".\t7229CW.obj". |# I0563 Accepting link directive '/IMPORT:GetStdHandle'. |# I0563 Accepting link directive '/IMPORT:WriteFile'. |# I0560 Linking COFF module ".\t7229CB.obj". |# I0563 Accepting link directive '/IMPORT:Beep'. |# I0560 Linking COFF module ".\t7229CE.obj". |# I0563 Accepting link directive '/IMPORT:ExitProcess'. | |;; | |t7229 PROGRAM FORMAT=COFF,MODEL=FLAT,WIDTH=32, \ | | LISTMAP=ON,LISTGLOBALS=ON | | GLOBAL Write.W32, Exit.W32 ; Intentionally omitted Beep.W32. | | LINK t7229C.lib | |ENDPROGRAM t7229 |# I0560 Linking LIBCOF module ".\t7229C.lib". | **** ListMap "t7229.obj",groups=0,segments=2,entry=,stack= | [.text],RVA=00000000h,size=00000057h=87,width=32,align=0010h,purpose=CODE | [.drectve],RVA=00000000h,size=00000048h=72,width=0,align=0,purpose=DRECTVE | **** ListGlobals "t7229.obj",Global=2,Public=1,Extern=0,eXport=0,Import=4 | Beep,[Beep]:00000000h,scope='I',lib="kernel32.dll" | Beep.W32,[.text]:00000030h,scope='P' | Exit.W32,[.text]:00000050h,scope='G' | ExitProcess,[ExitProcess]:00000000h,scope='I',lib="kernel32.dll" | GetStdHandle,[GetStdHandle]:00000000h,scope='I',lib="kernel32.dll" | Write.W32,[.text]:00000000h,scope='G' | WriteFile,[WriteFile]:00000000h,scope='I',lib="kernel32.dll"
Expected messages t7229.out
I0180 Assembling source file "t7229.htm". I0270 Assembling source "t7229". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t7229CW". "t7229.htm"{62} I0510 Assembling program pass 1. "t7229.htm"{62} I0510 Assembling program pass 2. "t7229.htm"{62} I0530 Assembling program pass 3 - final. "t7229.htm"{62} I0660 32bit FLAT COFF file "t7229CW.obj" created, size=395. "t7229.htm"{88} I0650 Program "t7229CW" assembled in 3 passes with errorlevel 0. "t7229.htm"{88} I0470 Assembling program "t7229CB". "t7229.htm"{97} I0510 Assembling program pass 1. "t7229.htm"{97} I0510 Assembling program pass 2. "t7229.htm"{97} I0530 Assembling program pass 3 - final. "t7229.htm"{97} I0660 32bit FLAT COFF file "t7229CB.obj" created, size=314. "t7229.htm"{111} I0650 Program "t7229CB" assembled in 3 passes with errorlevel 0. "t7229.htm"{111} I0470 Assembling program "t7229CE". "t7229.htm"{119} I0510 Assembling program pass 1. "t7229.htm"{119} I0510 Assembling program pass 2. "t7229.htm"{119} I0530 Assembling program pass 3 - final. "t7229.htm"{119} I0660 32bit FLAT COFF file "t7229CE.obj" created, size=298. "t7229.htm"{128} I0650 Program "t7229CE" assembled in 3 passes with errorlevel 0. "t7229.htm"{128} I0470 Assembling program "t7229C". "t7229.htm"{136} I0510 Assembling program pass 1. "t7229.htm"{136} I0530 Assembling program pass 2 - final. "t7229.htm"{136} I0560 Linking COFF module ".\t7229CW.obj". "t7229.htm"{139} I0563 Accepting link directive '/IMPORT:GetStdHandle'. "t7229.htm"{139} I0563 Accepting link directive '/IMPORT:WriteFile'. "t7229.htm"{139} I0560 Linking COFF module ".\t7229CB.obj". "t7229.htm"{139} I0563 Accepting link directive '/IMPORT:Beep'. "t7229.htm"{139} I0560 Linking COFF module ".\t7229CE.obj". "t7229.htm"{139} I0563 Accepting link directive '/IMPORT:ExitProcess'. "t7229.htm"{139} I0660 32bit FLAT LIBCOF file "t7229C.lib" created, size=1708. "t7229.htm"{139} I0650 Program "t7229C" assembled in 2 passes with errorlevel 0. "t7229.htm"{139} I0470 Assembling program "t7229". "t7229.htm"{148} I0510 Assembling program pass 1. "t7229.htm"{148} I0510 Assembling program pass 2. "t7229.htm"{148} I0530 Assembling program pass 3 - final. "t7229.htm"{148} I0560 Linking LIBCOF module ".\t7229C.lib". "t7229.htm"{152} I0660 32bit FLAT COFF file "t7229.obj" created, size=593. "t7229.htm"{152} I0650 Program "t7229" assembled in 3 passes with errorlevel 0. "t7229.htm"{152} I0750 Source "t7229" (256 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t7229.htm.lst" created, size=7351. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t7229. obj
0000: 4C 01 02 00 00 00 00 00 36 01 00 00 0D 00 00 00  L··°°°°°6·°°·°°°
0010: 00 00 00 01 2E 74 65 78 74 00 00 00 00 00 00 00  °°°·.text°°°°°°°
0020: 00 00 00 00 57 00 00 00 64 00 00 00 BC 00 00 00  °°°°W°°°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: EE 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ¤°°°°°°°°°°°°°°°
0060: 00 0A 10 02 6A F5 E8 00 00 00 00 89 C3 89 F7 31  °¬··j¤¤°°°°¤¤¤¤1
0070: C9 31 C0 F7 D1 F2 AE F7 D1 52 89 E2 50 52 51 56  ¤1¤¤¤¤¤¤¤R¤¤PRQV
0080: 53 E8 00 00 00 00 5A C3 90 90 90 90 90 90 90 90  S¤°°°°Z¤¤¤¤¤¤¤¤¤
0090: 90 90 90 90 68 C8 00 00 00 68 B8 01 00 00 E8 00  ¤¤¤¤h¤°°°h¤·°°¤°
00A0: 00 00 00 68 90 01 00 00 68 4B 02 00 00 E8 00 00  °°°h¤·°°hK·°°¤°°
00B0: 00 00 C3 90 6A 00 E9 00 00 00 00 00 03 00 00 00  °°¤¤j°¤°°°°°·°°°
00C0: 06 00 00 00 14 00 1E 00 00 00 07 00 00 00 14 00  ·°°°·°·°°°·°°°·°
00D0: 3B 00 00 00 09 00 00 00 14 00 4A 00 00 00 09 00  ;°°°·°°°·°J°°°·°
00E0: 00 00 14 00 53 00 00 00 0B 00 00 00 14 00 20 2F  °°·°S°°°·°°°·°¯/
00F0: 49 4D 50 4F 52 54 3A 47 65 74 53 74 64 48 61 6E  IMPORT:GetStdHan
0100: 64 6C 65 20 2F 49 4D 50 4F 52 54 3A 57 72 69 74  dle¯/IMPORT:Writ
0110: 65 46 69 6C 65 20 2F 49 4D 50 4F 52 54 3A 42 65  eFile¯/IMPORT:Be
0120: 65 70 20 2F 49 4D 50 4F 52 54 3A 45 78 69 74 50  ep¯/IMPORT:ExitP
0130: 72 6F 63 65 73 73 2E 66 69 6C 65 00 00 00 00 00  rocess.file°°°°°
0140: 00 00 FE FF 00 00 67 01 74 37 32 32 39 2E 68 74  °°¤¤°°g·t7229.ht
0150: 6D 00 00 00 00 00 00 00 00 00 2E 74 65 78 74 00  m°°°°°°°°°.text°
0160: 00 00 00 00 00 00 01 00 00 00 03 01 57 00 00 00  °°°°°°·°°°··W°°°
0170: 05 00 00 00 00 00 00 00 00 00 00 00 00 00 2E 64  ·°°°°°°°°°°°°°.d
0180: 72 65 63 74 76 65 00 00 00 00 02 00 00 00 03 01  rectve°°°°·°°°··
0190: 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  H°°°°°°°°°°°°°°°
01A0: 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 00  °°°°°°·°°°°°°°°°
01B0: 01 01 02 00 00 00 00 00 11 00 00 00 00 00 00 00  ···°°°°°·°°°°°°°
01C0: 00 00 01 01 02 00 00 00 00 00 1B 00 00 00 00 00  °°···°°°°°·°°°°°
01D0: 00 00 01 00 01 02 02 00 42 65 65 70 00 00 00 00  °°·°···°Beep°°°°
01E0: 00 00 00 00 00 00 01 01 02 00 42 65 65 70 2E 57  °°°°°°···°Beep.W
01F0: 33 32 30 00 00 00 01 00 01 02 02 00 00 00 00 00  320°°°·°···°°°°°
0200: 25 00 00 00 00 00 00 00 00 00 01 01 02 00 45 78  %°°°°°°°°°···°Ex
0210: 69 74 2E 57 33 32 50 00 00 00 01 00 01 02 02 00  it.W32P°°°·°···°
0220: 31 00 00 00 47 65 74 53 74 64 48 61 6E 64 6C 65  1°°°GetStdHandle
0230: 00 57 72 69 74 65 46 69 6C 65 00 57 72 69 74 65  °WriteFile°Write
0240: 2E 57 33 32 00 45 78 69 74 50 72 6F 63 65 73 73  .W32°ExitProcess
0250: 00                                               °

▲Back to the top▲