EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t8600: LIBOMF library for 32bit Windows


Source & expected listing t8600.htm.lst
| | EUROASM AUTOSEGMENT=ON,CPU=386,DUMPWIDTH=25 |7438363030 |%test %SET t8600 | |;; | |%test 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]. | |;; |[.data] ::::Section changed. |00000000:333262697420~~|Msg:: DB '%^WIDTH[]bit %^MODEL %^FORMAT program "%^OUTFILE".',13,10,0 |[.text] ::::Section changed. |0000006B: | ENDPROC Exit.W32: |[@LT1] ====ListLiterals in section [@LT1]. |00000000:42656570696E~~=B"Beeping..." | |ENDPROGRAM %test | **** ListMap "t8600.lib",model=FLAT,groups=0,segments=4,entry=,stack= | [.text],FA=000001A7h,RVA=00000000h,size=0000006Bh=107,width=32,align=0010h,purpose=CODE | [.rodata],FA=0000023Bh,RVA=00000000h,size=0000000Bh=11,width=32,align=0010h,purpose=RODATA+LITERAL | [.data],FA=0000024Fh,RVA=00000000h,size=00000029h=41,width=32,align=0010h,purpose=DATA | [.bss],FA=00000000h,RVA=00000000h,size=00000007h=7,width=32,align=0010h,purpose=BSS | **** ListGlobals "t8600.lib",Global=0,Public=4,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" | Msg,[.data]:00000000h,scope='P' | Write.W32,[.text]:00000000h,scope='P' | WriteFile,[WriteFile]:00000000h,scope='I',lib="kernel32.dll"
Expected messages t8600.out
I0180 Assembling source file "t8600.htm". I0270 Assembling source "t8600". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t8600". "t8600.htm"{44} I0510 Assembling program pass 1. "t8600.htm"{44} I0510 Assembling program pass 2. "t8600.htm"{44} I0530 Assembling program pass 3 - final. "t8600.htm"{44} I0660 32bit FLAT LIBOMF file "t8600.lib" created, size=2048. "t8600.htm"{99} I0650 Program "t8600" assembled in 3 passes with errorlevel 0. "t8600.htm"{99} I0750 Source "t8600" (264 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t8600.htm.lst" created, size=5576. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t8600. lib
0000: F0 0D 00 00 04 00 00 02 00 01 00 00 00 00 00 00  ¤·°°·°°·°·°°°°°°
0010: 82 07 00 05 74 38 36 30 30 30 88 10 00 00 00 45  ¤·°·t86000¤·°°°E
0020: 75 72 6F 41 73 73 65 6D 62 6C 65 72 2F 88 05 00  uroAssembler/¤·°
0030: 00 9D 33 66 3D 88 2C 00 80 A0 01 00 0C 47 65 74  °¤3f=¤,°¤¤·°·Get
0040: 53 74 64 48 61 6E 64 6C 65 0C 6B 65 72 6E 65 6C  StdHandle·kernel
0050: 33 32 2E 64 6C 6C 0C 47 65 74 53 74 64 48 61 6E  32.dll·GetStdHan
0060: 64 6C 65 89 88 26 00 80 A0 01 00 09 57 72 69 74  dle¤¤&°¤¤·°·Writ
0070: 65 46 69 6C 65 0C 6B 65 72 6E 65 6C 33 32 2E 64  eFile·kernel32.d
0080: 6C 6C 09 57 72 69 74 65 46 69 6C 65 AD 88 1C 00  ll·WriteFile¤¤·°
0090: 80 A0 01 00 04 42 65 65 70 0C 6B 65 72 6E 65 6C  ¤¤·°·Beep·kernel
00A0: 33 32 2E 64 6C 6C 04 42 65 65 70 DF 88 2A 00 80  32.dll·Beep¤¤*°¤
00B0: A0 01 00 0B 45 78 69 74 50 72 6F 63 65 73 73 0C  ¤·°·ExitProcess·
00C0: 6B 65 72 6E 65 6C 33 32 2E 64 6C 6C 0B 45 78 69  kernel32.dll·Exi
00D0: 74 50 72 6F 63 65 73 73 C9 96 1B 00 00 05 2E 74  tProcess¤¤·°°·.t
00E0: 65 78 74 07 2E 72 6F 64 61 74 61 05 2E 64 61 74  ext·.rodata·.dat
00F0: 61 04 2E 62 73 73 60 99 09 00 69 6B 00 00 00 02  a·.bss`¤·°ik°°°·
0100: 01 00 87 99 09 00 69 0B 00 00 00 03 01 00 E6 99  ·°¤¤·°i·°°°··°¤¤
0110: 09 00 69 29 00 00 00 04 01 00 C7 99 09 00 69 07  ·°i)°°°··°¤¤·°i·
0120: 00 00 00 05 01 00 E8 8C 0F 00 0C 47 65 74 53 74  °°°··°¤¤·°·GetSt
0130: 64 48 61 6E 64 6C 65 00 C2 8C 0C 00 09 57 72 69  dHandle°¤¤·°·Wri
0140: 74 65 46 69 6C 65 00 D4 8C 07 00 04 42 65 65 70  teFile°¤¤·°·Beep
0150: 00 ED 8C 0E 00 0B 45 78 69 74 50 72 6F 63 65 73  °¤¤·°·ExitProces
0160: 73 00 E2 90 10 00 00 01 09 57 72 69 74 65 2E 57  s°¤¤·°°··Write.W
0170: 33 32 00 00 00 61 90 0F 00 00 01 08 42 65 65 70  32°°°a¤·°°··Beep
0180: 2E 57 33 32 24 00 00 CE 90 0F 00 00 01 08 45 78  .W32$°°¤¤·°°··Ex
0190: 69 74 2E 57 33 32 4D 00 00 87 90 0A 00 00 03 03  it.W32M°°¤¤¬°°··
01A0: 4D 73 67 00 00 00 39 A1 71 00 01 00 00 00 00 6A  Msg°°°9¤q°·°°°°j
01B0: F5 E8 00 00 00 00 89 C3 89 F7 31 C9 31 C0 F7 D1  ¤¤°°°°¤¤¤¤1¤1¤¤¤
01C0: F2 AE F7 D1 52 89 E2 50 52 51 56 53 E8 00 00 00  ¤¤¤¤R¤¤PRQVS¤°°°
01D0: 00 5A C3 BE 00 00 00 00 E8 D2 FF FF FF 68 C8 00  °Z¤¤°°°°¤¤¤¤¤h¤°
01E0: 00 00 68 B8 01 00 00 E8 00 00 00 00 68 90 01 00  °°h¤·°°¤°°°°h¤·°
01F0: 00 68 4B 02 00 00 E8 00 00 00 00 C3 BE 00 00 00  °hK·°°¤°°°°¤¤°°°
0200: 00 C7 06 45 6E 64 00 C7 46 03 0D 0A 00 00 E8 9C  °¤·End°¤F··¬°°¤¤
0210: FF FF FF 6A 00 E9 00 00 00 00 BD 9D 1D 00 A4 03  ¤¤¤j°¤°°°°¤¤·°¤·
0220: 56 01 A4 1E 56 02 E4 25 54 02 A4 39 56 03 A4 48  V·¤·V·¤%T·¤9V·¤H
0230: 56 03 E4 4E 54 04 A4 67 56 04 65 A1 11 00 02 00  V·¤NT·¤gV·e¤·°·°
0240: 00 00 00 42 65 65 70 69 6E 67 2E 2E 2E 00 08 A1  °°°Beeping...°·¤
0250: 2F 00 03 00 00 00 00 33 32 62 69 74 20 46 4C 41  /°·°°°°32bit¯FLA
0260: 54 20 4C 49 42 4F 4D 46 20 70 72 6F 67 72 61 6D  T¯LIBOMF¯program
0270: 20 22 74 38 36 30 30 2E 6C 69 62 22 2E 0D 0A 00  ¯"t8600.lib".·¬°
0280: 01 8B 0C 00 00 00 00 00 00 00 00 00 00 00 00 69  ·¤·°°°°°°°°°°°°i
0290: F1 6D 01 00 00 00 00 00 00 00 00 00 00 00 00 00  ¤m·°°°°°°°°°°°°°
02A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
02B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
02C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
02D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
02E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
02F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0350: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0360: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
03A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
03B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
03C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
03D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
03E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
03F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A1  °°°°°°°°°°°°°°°¤
0400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1B  °°°°°°°°°°°°°°°·
0410: 00 00 00 00 00 00 00 00 00 21 13 00 27 00 00 00  °°°°°°°°°!·°'°°°
0420: 00 00 00 00 00 2D 0C 47 65 74 53 74 64 48 61 6E  °°°°°-·GetStdHan
0430: 64 6C 65 01 00 00 09 57 72 69 74 65 46 69 6C 65  dle·°°·WriteFile
0440: 01 00 08 42 65 65 70 2E 57 33 32 01 00 00 08 45  ·°·Beep.W32·°°·E
0450: 78 69 74 2E 57 33 32 01 00 00 00 00 00 00 00 00  xit.W32·°°°°°°°°
0460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
04A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
04B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
04C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
04D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
04E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
04F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
05A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
05B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
05C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
05D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
05E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
05F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0600: 00 00 00 00 1D 00 00 00 00 00 00 00 00 00 00 00  °°°°·°°°°°°°°°°°
0610: 00 00 19 00 00 00 00 00 00 00 00 24 00 00 00 00  °°·°°°°°°°°$°°°°
0620: 00 00 00 13 00 27 09 57 72 69 74 65 2E 57 33 32  °°°·°'·Write.W32
0630: 01 00 04 42 65 65 70 01 00 00 0B 45 78 69 74 50  ·°·Beep·°°·ExitP
0640: 72 6F 63 65 73 73 01 00 03 4D 73 67 01 00 00 00  rocess·°·Msg·°°°
0650: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0660: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
06A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
06B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
06C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
06D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
06E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
06F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0710: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0730: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0740: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0750: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0760: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0770: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
07A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
07B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
07C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
07D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
07E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
07F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°

▲Back to the top▲