EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t9108: LIBCOF library for 32bit Windows links LIBOMF library


Source & expected listing t9108.htm.lst
| | EUROASM AUTOSEGMENT=ON,CPU=386,DUMPWIDTH=25 |7439313038 |%test %SET t9108 | |;; | |;; Create the auxilliary LIBOMF library "%test.omf.lib". | |%test.omf PROGRAM FORMAT=LIBOMF,MODEL=FLAT,WIDTH=32 |[.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: |[@LT1] ====ListLiterals in section [@LT1]. |00000000:42656570696E~~=B"Beeping..." | |ENDPROGRAM %test.omf | **** ListMap "t9108.omf.lib",model=FLAT,groups=0,segments=3,entry=,stack= | [.text],FA=0000018Ch,RVA=00000000h,size=0000006Bh=107,width=32,align=0010h,purpose=CODE | [.rodata],FA=00000220h,RVA=00000000h,size=0000000Bh=11,width=32,align=0010h,purpose=RODATA+LITERAL | [.bss],FA=00000000h,RVA=00000000h,size=00000007h=7,width=32,align=0010h,purpose=BSS | **** ListGlobals "t9108.omf.lib",Global=0,Public=3,Extern=0,eXport=0,Import=4 | Beep,[Beep]:00000000h,scope='I',lib="kernel32.dll" | Beep.W32,[.text]:00000024h,scope='P' | Exit.W32,[.text]:0000004Dh,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" | |;; | |;; Create the main LIBCOF library from LIBOMF library. | |%test PROGRAM FORMAT=LIBCOF,MODEL=FLAT,WIDTH=32 | | LINK %test.omf.lib |[.data] ::::Section changed. |00000000:333262697420~~|Msg:: DB '%^WIDTH[]bit %^MODEL %^FORMAT program "%^OUTFILE".',13,10,0 | | ENDPROGRAM %test |# I0561 Linking LIBOMF library ".\t9108.omf.lib". | **** ListMap "t9108.lib",model=FLAT,groups=0,segments=1,entry=,stack= | [.data],FA=0000003Ch,RVA=00000000h,size=00000029h=41,width=32,align=0010h,purpose=DATA | **** ListGlobals "t9108.lib",Global=0,Public=1,Extern=0,eXport=0,Import=0 | Msg,[.data]:00000000h,scope='P'
Expected messages t9108.out
I0180 Assembling source file "t9108.htm". I0270 Assembling source "t9108". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t9108.omf". "t9108.htm"{45} I0510 Assembling program pass 1. "t9108.htm"{45} I0510 Assembling program pass 2. "t9108.htm"{45} I0530 Assembling program pass 3 - final. "t9108.htm"{45} I0660 32bit FLAT LIBOMF file "t9108.omf.lib" created, size=2048. "t9108.htm"{97} I0650 Program "t9108.omf" assembled in 3 passes with errorlevel 0. "t9108.htm"{97} I0470 Assembling program "t9108". "t9108.htm"{112} I0510 Assembling program pass 1. "t9108.htm"{112} I0510 Assembling program pass 2. "t9108.htm"{112} I0530 Assembling program pass 3 - final. "t9108.htm"{112} I0561 Linking LIBOMF library ".\t9108.omf.lib". "t9108.htm"{116} I0660 32bit FLAT LIBCOF file "t9108.lib" created, size=1873. "t9108.htm"{116} I0650 Program "t9108" assembled in 3 passes with errorlevel 0. "t9108.htm"{116} I0750 Source "t9108" (269 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t9108.htm.lst" created, size=6142. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t9108. 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 35 30 20 20 20 20 20  100666¯¯150¯¯¯¯¯
0040: 20 20 60 0A 00 00 00 0C 00 00 01 EE 00 00 01 EE  ¯¯`¬°°°·°°·¤°°·¤
0050: 00 00 02 EE 00 00 03 58 00 00 03 C0 00 00 04 22  °°·¤°°·X°°·¤°°·"
0060: 00 00 04 8C 00 00 04 8C 00 00 04 8C 00 00 04 8C  °°·¤°°·¤°°·¤°°·¤
0070: 00 00 04 8C 00 00 04 8C 2E 64 61 74 61 00 4D 73  °°·¤°°·¤.data°Ms
0080: 67 00 47 65 74 53 74 64 48 61 6E 64 6C 65 00 57  g°GetStdHandle°W
0090: 72 69 74 65 46 69 6C 65 00 42 65 65 70 00 45 78  riteFile°Beep°Ex
00A0: 69 74 50 72 6F 63 65 73 73 00 2E 74 65 78 74 00  itProcess°.text°
00B0: 2E 72 6F 64 61 74 61 00 2E 62 73 73 00 57 72 69  .rodata°.bss°Wri
00C0: 74 65 2E 57 33 32 00 42 65 65 70 2E 57 33 32 00  te.W32°Beep.W32°
00D0: 45 78 69 74 2E 57 33 32 00 0A 2F 20 20 20 20 20  Exit.W32°¬/¯¯¯¯¯
00E0: 20 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20  ¯¯¯¯¯¯¯¯¯¯0¯¯¯¯¯
00F0: 20 20 20 20 20 20 30 20 20 20 20 20 30 20 20 20  ¯¯¯¯¯¯0¯¯¯¯¯0¯¯¯
0100: 20 20 31 30 30 36 36 36 20 20 31 35 34 20 20 20  ¯¯100666¯¯154¯¯¯
0110: 20 20 20 20 60 0A 06 00 00 00 EE 01 00 00 EE 02  ¯¯¯¯`¬·°°°¤·°°¤·
0120: 00 00 58 03 00 00 C0 03 00 00 22 04 00 00 8C 04  °°X·°°¤·°°"·°°¤·
0130: 00 00 0C 00 00 00 06 00 01 00 06 00 06 00 04 00  °°·°°°·°·°·°·°·°
0140: 06 00 06 00 05 00 02 00 01 00 06 00 03 00 2E 62  ·°·°·°·°·°·°·°.b
0150: 73 73 00 2E 64 61 74 61 00 2E 72 6F 64 61 74 61  ss°.data°.rodata
0160: 00 2E 74 65 78 74 00 42 65 65 70 00 42 65 65 70  °.text°Beep°Beep
0170: 2E 57 33 32 00 45 78 69 74 2E 57 33 32 00 45 78  .W32°Exit.W32°Ex
0180: 69 74 50 72 6F 63 65 73 73 00 47 65 74 53 74 64  itProcess°GetStd
0190: 48 61 6E 64 6C 65 00 4D 73 67 00 57 72 69 74 65  Handle°Msg°Write
01A0: 2E 57 33 32 00 57 72 69 74 65 46 69 6C 65 00 0A  .W32°WriteFile°¬
01B0: 2F 2F 20 20 20 20 20 20 20 20 20 20 20 20 20 20  //¯¯¯¯¯¯¯¯¯¯¯¯¯¯
01C0: 30 20 20 20 20 20 20 20 20 20 20 20 30 20 20 20  0¯¯¯¯¯¯¯¯¯¯¯0¯¯¯
01D0: 20 20 30 20 20 20 20 20 31 30 30 36 36 36 20 20  ¯¯0¯¯¯¯¯100666¯¯
01E0: 32 20 20 20 20 20 20 20 20 20 60 0A 00 0A 74 39  2¯¯¯¯¯¯¯¯¯`¬°¬t9
01F0: 31 30 38 2F 20 20 20 20 20 20 20 20 20 20 30 20  108/¯¯¯¯¯¯¯¯¯¯0¯
0200: 20 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20  ¯¯¯¯¯¯¯¯¯¯0¯¯¯¯¯
0210: 30 20 20 20 20 20 31 30 30 36 36 36 20 20 31 39  0¯¯¯¯¯100666¯¯19
0220: 36 20 20 20 20 20 20 20 60 0A 4C 01 01 00 00 00  6¯¯¯¯¯¯¯`¬L··°°°
0230: 00 00 66 00 00 00 05 00 00 00 00 00 00 01 2E 64  °°f°°°·°°°°°°·.d
0240: 61 74 61 00 00 00 00 00 00 00 00 00 00 00 29 00  ata°°°°°°°°°°°)°
0250: 00 00 3C 00 00 00 00 00 00 00 00 00 00 00 00 00  °°<°°°°°°°°°°°°°
0260: 00 00 40 00 50 C0 33 32 62 69 74 20 46 4C 41 54  °°@°P¤32bit¯FLAT
0270: 20 4C 49 42 43 4F 46 20 70 72 6F 67 72 61 6D 20  ¯LIBCOF¯program¯
0280: 22 74 39 31 30 38 2E 6C 69 62 22 2E 0D 0A 00 00  "t9108.lib".·¬°°
0290: 2E 66 69 6C 65 00 00 00 00 00 00 00 FE FF 00 00  .file°°°°°°°¤¤°°
02A0: 67 01 74 39 31 30 38 2E 68 74 6D 00 00 00 00 00  g·t9108.htm°°°°°
02B0: 00 00 00 00 2E 64 61 74 61 00 00 00 00 00 00 00  °°°°.data°°°°°°°
02C0: 01 00 00 00 03 01 29 00 00 00 00 00 00 00 00 00  ·°°°··)°°°°°°°°°
02D0: 00 00 00 00 00 00 00 00 4D 73 67 00 00 00 00 00  °°°°°°°°Msg°°°°°
02E0: 00 00 00 00 01 00 0C 00 02 00 04 00 00 00 47 65  °°°°·°·°·°·°°°Ge
02F0: 74 53 74 64 48 61 6E 64 6C 65 2F 20 20 20 30 20  tStdHandle/¯¯¯0¯
0300: 20 20 20 20 20 20 20 20 20 20 30 20 20 20 20 20  ¯¯¯¯¯¯¯¯¯¯0¯¯¯¯¯
0310: 30 20 20 20 20 20 31 30 30 36 36 36 20 20 34 36  0¯¯¯¯¯100666¯¯46
0320: 20 20 20 20 20 20 20 20 60 0A 00 00 FF FF 00 00  ¯¯¯¯¯¯¯¯`¬°°¤¤°°
0330: 4C 01 00 00 00 00 1A 00 00 00 00 00 04 00 47 65  L·°°°°·°°°°°·°Ge
0340: 74 53 74 64 48 61 6E 64 6C 65 00 6B 65 72 6E 65  tStdHandle°kerne
0350: 6C 33 32 2E 64 6C 6C 00 57 72 69 74 65 46 69 6C  l32.dll°WriteFil
0360: 65 2F 20 20 20 20 20 20 30 20 20 20 20 20 20 20  e/¯¯¯¯¯¯0¯¯¯¯¯¯¯
0370: 20 20 20 20 30 20 20 20 20 20 30 20 20 20 20 20  ¯¯¯¯0¯¯¯¯¯0¯¯¯¯¯
0380: 31 30 30 36 36 36 20 20 34 33 20 20 20 20 20 20  100666¯¯43¯¯¯¯¯¯
0390: 20 20 60 0A 00 00 FF FF 00 00 4C 01 00 00 00 00  ¯¯`¬°°¤¤°°L·°°°°
03A0: 17 00 00 00 00 00 04 00 57 72 69 74 65 46 69 6C  ·°°°°°·°WriteFil
03B0: 65 00 6B 65 72 6E 65 6C 33 32 2E 64 6C 6C 00 10  e°kernel32.dll°·
03C0: 42 65 65 70 2F 20 20 20 20 20 20 20 20 20 20 20  Beep/¯¯¯¯¯¯¯¯¯¯¯
03D0: 30 20 20 20 20 20 20 20 20 20 20 20 30 20 20 20  0¯¯¯¯¯¯¯¯¯¯¯0¯¯¯
03E0: 20 20 30 20 20 20 20 20 31 30 30 36 36 36 20 20  ¯¯0¯¯¯¯¯100666¯¯
03F0: 33 38 20 20 20 20 20 20 20 20 60 0A 00 00 FF FF  38¯¯¯¯¯¯¯¯`¬°°¤¤
0400: 00 00 4C 01 00 00 00 00 12 00 00 00 00 00 04 00  °°L·°°°°·°°°°°·°
0410: 42 65 65 70 00 6B 65 72 6E 65 6C 33 32 2E 64 6C  Beep°kernel32.dl
0420: 6C 00 45 78 69 74 50 72 6F 63 65 73 73 2F 20 20  l°ExitProcess/¯¯
0430: 20 20 30 20 20 20 20 20 20 20 20 20 20 20 30 20  ¯¯0¯¯¯¯¯¯¯¯¯¯¯0¯
0440: 20 20 20 20 30 20 20 20 20 20 31 30 30 36 36 36  ¯¯¯¯0¯¯¯¯¯100666
0450: 20 20 34 35 20 20 20 20 20 20 20 20 60 0A 00 00  ¯¯45¯¯¯¯¯¯¯¯`¬°°
0460: FF FF 00 00 4C 01 00 00 00 00 19 00 00 00 00 00  ¤¤°°L·°°°°·°°°°°
0470: 04 00 45 78 69 74 50 72 6F 63 65 73 73 00 6B 65  ·°ExitProcess°ke
0480: 72 6E 65 6C 33 32 2E 64 6C 6C 00 10 74 39 31 30  rnel32.dll°·t910
0490: 38 2E 6F 6D 66 2F 20 20 20 20 20 20 30 20 20 20  8.omf/¯¯¯¯¯¯0¯¯¯
04A0: 20 20 20 20 20 20 20 20 30 20 20 20 20 20 30 20  ¯¯¯¯¯¯¯¯0¯¯¯¯¯0¯
04B0: 20 20 20 20 31 30 30 36 36 36 20 20 36 34 39 20  ¯¯¯¯100666¯¯649¯
04C0: 20 20 20 20 20 20 60 0A 4C 01 03 00 00 00 00 00  ¯¯¯¯¯¯`¬L··°°°°°
04D0: 4A 01 00 00 0F 00 00 00 00 00 00 01 2E 74 65 78  J·°°·°°°°°°·.tex
04E0: 74 00 00 00 00 00 00 00 00 00 00 00 6B 00 00 00  t°°°°°°°°°°°k°°°
04F0: 8C 00 00 00 F8 00 00 00 00 00 00 00 07 00 00 00  ¤°°°¤°°°°°°°·°°°
0500: 20 00 50 60 2E 72 6F 64 61 74 61 00 00 00 00 00  ¯°P`.rodata°°°°°
0510: 00 00 00 00 0B 00 00 00 3E 01 00 00 00 00 00 00  °°°°·°°°>·°°°°°°
0520: 00 00 00 00 00 00 00 00 40 00 50 40 2E 62 73 73  °°°°°°°°@°P@.bss
0530: 00 00 00 00 00 00 00 00 00 00 00 00 07 00 00 00  °°°°°°°°°°°°·°°°
0540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0550: 80 00 50 C0 6A F5 E8 00 00 00 00 89 C3 89 F7 31  ¤°P¤j¤¤°°°°¤¤¤¤1
0560: C9 31 C0 F7 D1 F2 AE F7 D1 52 89 E2 50 52 51 56  ¤1¤¤¤¤¤¤¤R¤¤PRQV
0570: 53 E8 00 00 00 00 5A C3 BE 00 00 00 00 E8 D2 FF  S¤°°°°Z¤¤°°°°¤¤¤
0580: FF FF 68 C8 00 00 00 68 B8 01 00 00 E8 00 00 00  ¤¤h¤°°°h¤·°°¤°°°
0590: 00 68 90 01 00 00 68 4B 02 00 00 E8 00 00 00 00  °h¤·°°hK·°°¤°°°°
05A0: C3 BE 00 00 00 00 C7 06 45 6E 64 00 C7 46 03 0D  ¤¤°°°°¤·End°¤F··
05B0: 0A 00 00 E8 9C FF FF FF 6A 00 E9 00 00 00 00 00  ¬°°¤¤¤¤¤j°¤°°°°°
05C0: 03 00 00 00 0C 00 00 00 14 00 1E 00 00 00 0E 00  ·°°°·°°°·°·°°°·°
05D0: 00 00 14 00 25 00 00 00 04 00 00 00 06 00 39 00  °°·°%°°°·°°°·°9°
05E0: 00 00 08 00 00 00 14 00 48 00 00 00 08 00 00 00  °°·°°°·°H°°°·°°°
05F0: 14 00 4E 00 00 00 02 00 00 00 06 00 67 00 00 00  ·°N°°°·°°°·°g°°°
0600: 0B 00 00 00 14 00 42 65 65 70 69 6E 67 2E 2E 2E  ·°°°·°Beeping...
0610: 00 00 2E 66 69 6C 65 00 00 00 00 00 00 00 FE FF  °°.file°°°°°°°¤¤
0620: 00 00 67 01 74 39 31 30 38 2E 68 74 6D 00 00 00  °°g·t9108.htm°°°
0630: 00 00 00 00 00 00 2E 62 73 73 00 00 00 00 00 00  °°°°°°.bss°°°°°°
0640: 00 00 03 00 00 00 03 01 00 00 00 00 00 00 00 00  °°·°°°··°°°°°°°°
0650: 00 00 00 00 00 00 00 00 00 00 2E 72 6F 64 61 74  °°°°°°°°°°.rodat
0660: 61 00 00 00 00 00 02 00 00 00 03 01 0B 00 00 00  a°°°°°·°°°···°°°
0670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 2E 74  °°°°°°°°°°°°°°.t
0680: 65 78 74 00 00 00 00 00 00 00 01 00 00 00 03 01  ext°°°°°°°·°°°··
0690: 6B 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00  k°°°·°°°°°°°°°°°
06A0: 00 00 42 65 65 70 00 00 00 00 00 00 00 00 00 00  °°Beep°°°°°°°°°°
06B0: 01 01 02 00 42 65 65 70 2E 57 33 32 24 00 00 00  ···°Beep.W32$°°°
06C0: 01 00 00 00 02 00 45 78 69 74 2E 57 33 32 4D 00  ·°°°·°Exit.W32M°
06D0: 00 00 01 00 00 00 02 00 00 00 00 00 04 00 00 00  °°·°°°·°°°°°·°°°
06E0: 00 00 00 00 00 00 01 01 02 00 00 00 00 00 10 00  °°°°°°···°°°°°·°
06F0: 00 00 00 00 00 00 00 00 01 01 02 00 00 00 00 00  °°°°°°°°···°°°°°
0700: 1D 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00  ·°°°°°°°·°°°·°°°
0710: 00 00 27 00 00 00 00 00 00 00 00 00 01 01 02 00  °°'°°°°°°°°°···°
0720: 31 00 00 00 45 78 69 74 50 72 6F 63 65 73 73 00  1°°°ExitProcess°
0730: 47 65 74 53 74 64 48 61 6E 64 6C 65 00 57 72 69  GetStdHandle°Wri
0740: 74 65 2E 57 33 32 00 57 72 69 74 65 46 69 6C 65  te.W32°WriteFile
0750: 00                                               °

▲Back to the top▲