EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t7043: Compile OMF 32bit Win linking COFF 32bit Win


Description
Test creates linkable 32bit OMF file t7043.obj from linkable 32bit COFF module.
See also
LinkerCombinations  
Tested procedures
PfomfCompile   PfcoffLoadPgm  
Source & expected listing t7043.htm.lst
| |EUROASM DEBUG=OFF,PROFILE=OFF,AUTOSEGMENT=ON,LIST=ON, \ | |DUMP=ON,DUMPWIDTH=25,DUMPALL=OFF,CPU=386 | |;; | |t7043CW 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 t7043CW | **** ListMap "t7043CW.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 "t7043CW.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" | |;; | |t7043CB 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 t7043CB | **** ListMap "t7043CB.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 "t7043CB.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' | |;; | |t7043CE 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 t7043CE | **** ListMap "t7043CE.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 "t7043CE.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" | |;; | |t7043 PROGRAM FORMAT=OMF,MODEL=SMALL,WIDTH=32, \ | |LISTMAP=ON,LISTGLOBALS=ON | |LINK t7043CW.obj, t7043CB.obj, t7043CE.obj | |ENDPROGRAM t7043 |# I0560 Linking COFF module ".\t7043CW.obj". |# I0563 Accepting link directive '/IMPORT:GetStdHandle'. |# I0563 Accepting link directive '/IMPORT:WriteFile'. |# I0560 Linking COFF module ".\t7043CB.obj". |# I0563 Accepting link directive '/IMPORT:Beep'. |# I0560 Linking COFF module ".\t7043CE.obj". |# I0563 Accepting link directive '/IMPORT:ExitProcess'. | **** ListMap "t7043.obj",groups=0,segments=1,entry=,stack= | [.text],RVA=00000000h,size=00000057h=87,width=32,align=0010h,purpose=CODE | **** ListGlobals "t7043.obj",Global=0,Public=3,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='P' | ExitProcess,[ExitProcess]:00000000h,scope='I',lib="kernel32.dll" | GetStdHandle,[GetStdHandle]:00000000h,scope='I',lib="kernel32.dll" | Write.W32,[.text]:00000000h,scope='P' | WriteFile,[WriteFile]:00000000h,scope='I',lib="kernel32.dll"
Expected messages t7043.out
I0180 Assembling source file "t7043.htm". I0270 Assembling source "t7043". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t7043CW". "t7043.htm"{62} I0510 Assembling program pass 1. "t7043.htm"{62} I0510 Assembling program pass 2. "t7043.htm"{62} I0530 Assembling program pass 3 - final. "t7043.htm"{62} I0660 32bit FLAT COFF file "t7043CW.obj" created, size=395. "t7043.htm"{88} I0650 Program "t7043CW" assembled in 3 passes with errorlevel 0. "t7043.htm"{88} I0470 Assembling program "t7043CB". "t7043.htm"{97} I0510 Assembling program pass 1. "t7043.htm"{97} I0510 Assembling program pass 2. "t7043.htm"{97} I0530 Assembling program pass 3 - final. "t7043.htm"{97} I0660 32bit FLAT COFF file "t7043CB.obj" created, size=314. "t7043.htm"{111} I0650 Program "t7043CB" assembled in 3 passes with errorlevel 0. "t7043.htm"{111} I0470 Assembling program "t7043CE". "t7043.htm"{119} I0510 Assembling program pass 1. "t7043.htm"{119} I0510 Assembling program pass 2. "t7043.htm"{119} I0530 Assembling program pass 3 - final. "t7043.htm"{119} I0660 32bit FLAT COFF file "t7043CE.obj" created, size=298. "t7043.htm"{128} I0650 Program "t7043CE" assembled in 3 passes with errorlevel 0. "t7043.htm"{128} I0470 Assembling program "t7043". "t7043.htm"{136} I0510 Assembling program pass 1. "t7043.htm"{136} I0530 Assembling program pass 2 - final. "t7043.htm"{136} I0560 Linking COFF module ".\t7043CW.obj". "t7043.htm"{139} I0563 Accepting link directive '/IMPORT:GetStdHandle'. "t7043.htm"{139} I0563 Accepting link directive '/IMPORT:WriteFile'. "t7043.htm"{139} I0560 Linking COFF module ".\t7043CB.obj". "t7043.htm"{139} I0563 Accepting link directive '/IMPORT:Beep'. "t7043.htm"{139} I0560 Linking COFF module ".\t7043CE.obj". "t7043.htm"{139} I0563 Accepting link directive '/IMPORT:ExitProcess'. "t7043.htm"{139} I0660 32bit SMALL OMF file "t7043.obj" created, size=464. "t7043.htm"{139} I0650 Program "t7043" assembled in 2 passes with errorlevel 0. "t7043.htm"{139} I0750 Source "t7043" (232 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t7043.htm.lst" created, size=6699. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t7043. obj
0000: 80 07 00 05 74 37 30 34 33 32 88 10 00 00 00 45  ¤·°·t70432¤·°°°E
0010: 75 72 6F 41 73 73 65 6D 62 6C 65 72 2F 88 05 00  uroAssembler/¤·°
0020: 00 9D 33 73 30 88 2C 00 80 A0 01 00 0C 47 65 74  °¤3s0¤,°¤¤·°·Get
0030: 53 74 64 48 61 6E 64 6C 65 0C 6B 65 72 6E 65 6C  StdHandle·kernel
0040: 33 32 2E 64 6C 6C 0C 47 65 74 53 74 64 48 61 6E  32.dll·GetStdHan
0050: 64 6C 65 89 88 26 00 80 A0 01 00 09 57 72 69 74  dle¤¤&°¤¤·°·Writ
0060: 65 46 69 6C 65 0C 6B 65 72 6E 65 6C 33 32 2E 64  eFile·kernel32.d
0070: 6C 6C 09 57 72 69 74 65 46 69 6C 65 AD 88 1C 00  ll·WriteFile¤¤·°
0080: 80 A0 01 00 04 42 65 65 70 0C 6B 65 72 6E 65 6C  ¤¤·°·Beep·kernel
0090: 33 32 2E 64 6C 6C 04 42 65 65 70 DF 88 2A 00 80  32.dll·Beep¤¤*°¤
00A0: A0 01 00 0B 45 78 69 74 50 72 6F 63 65 73 73 0C  ¤·°·ExitProcess·
00B0: 6B 65 72 6E 65 6C 33 32 2E 64 6C 6C 0B 45 78 69  kernel32.dll·Exi
00C0: 74 50 72 6F 63 65 73 73 C9 96 08 00 00 05 2E 74  tProcess¤¤·°°·.t
00D0: 65 78 74 6A 99 09 00 69 57 00 00 00 02 01 00 9B  extj¤·°iW°°°··°¤
00E0: 8C 0F 00 0C 47 65 74 53 74 64 48 61 6E 64 6C 65  ¤·°·GetStdHandle
00F0: 00 C2 8C 0C 00 09 57 72 69 74 65 46 69 6C 65 00  °¤¤·°·WriteFile°
0100: D4 8C 07 00 04 42 65 65 70 00 ED 8C 0E 00 0B 45  ¤¤·°·Beep°¤¤·°·E
0110: 78 69 74 50 72 6F 63 65 73 73 00 E2 90 10 00 00  xitProcess°¤¤·°°
0120: 01 09 57 72 69 74 65 2E 57 33 32 00 00 00 61 90  ··Write.W32°°°a¤
0130: 0F 00 00 01 08 42 65 65 70 2E 57 33 32 30 00 00  ·°°··Beep.W320°°
0140: C2 90 0F 00 00 01 08 45 78 69 74 2E 57 33 32 50  ¤¤·°°··Exit.W32P
0150: 00 00 84 A1 5D 00 01 00 00 00 00 6A F5 E8 00 00  °°¤¤]°·°°°°j¤¤°°
0160: 00 00 89 C3 89 F7 31 C9 31 C0 F7 D1 F2 AE F7 D1  °°¤¤¤¤1¤1¤¤¤¤¤¤¤
0170: 52 89 E2 50 52 51 56 53 E8 00 00 00 00 5A C3 90  R¤¤PRQVS¤°°°°Z¤¤
0180: 90 90 90 90 90 90 90 90 90 90 90 68 C8 00 00 00  ¤¤¤¤¤¤¤¤¤¤¤h¤°°°
0190: 68 B8 01 00 00 E8 00 00 00 00 68 90 01 00 00 68  h¤·°°¤°°°°h¤·°°h
01A0: 4B 02 00 00 E8 00 00 00 00 C3 90 6A 00 E9 00 00  K·°°¤°°°°¤¤j°¤°°
01B0: 00 00 40 9D 15 00 A4 03 56 01 A4 1E 56 02 A4 3B  °°@¤·°¤·V·¤·V·¤;
01C0: 56 03 A4 4A 56 03 A4 53 56 04 66 8A 02 00 00 74  V·¤JV·¤SV·f¤·°°t

▲Back to the top▲