EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t8950: COFF object module for 32bit Linux


Source & expected listing t8950.htm.lst
| | EUROASM AUTOSEGMENT=ON,CPU=386,DUMPWIDTH=28 |7438393530 |%test %SET t8950 | |;; | |%test PROGRAM FORMAT=COFF,MODEL=FLAT,WIDTH=32 |[.text] ::::Section changed. |00000000: |Write.L32:: PROC ; Display ASCIIZ string pointed to by ESI using 32bit Linux. |00000000:31C9 | XOR ECX,ECX ; Clear ECX to keep the size of input string. |00000002:31C0 | XOR EAX,EAX ; Clear AL, the searched terminating character |00000004:89F7 | MOV EDI,ESI ; String address. |00000006:F7D1 | NOT ECX ; Assume unlimited possible string size. |00000008:F2AE | REPNE SCASB ; Find the zero terminator. |0000000A:F7D1 | NOT ECX ; Get string size to RCX. |0000000C:B804000000 | MOV EAX,4 ; Kernel service sys_write. |00000011:BB01000000 | MOV EBX,1 ; %1 I/O handle STDOUT_FILENO. |00000016:89CA | MOV EDX,ECX ; %3 String size. |00000018:89F1 | MOV ECX,ESI ; %2 String address. |0000001A:CD80 | INT 0x80 ; Invoke kernel. |0000001C:C3 | RET ; Return to caller. EAX,EBX,ECX,EDX,ESI,EDI are clobbered. |0000001D: | ENDPROC Write.L32: | |;; |0000001D: |Beep.L32:: PROC ; Display message "Beeping.." and play a sound using 32bit Linux. |0000001D:8D35[00000000] | LEA ESI,[=B"Beeping..."] ; Define a literal string in [.rodata]. |00000023:E8D8FFFFFF | CALL Write.L32:: ; Display the notification "Beeping...". |00000028:8D35[00000000] | LEA ESI,[=W(0x0007)] ; Define ASCIIZ string with BEL character in [.rodata]. |0000002E:E8CDFFFFFF | CALL Write.L32:: ; Play the beep sound. |00000033:C3 | RET ; Return to caller. RAX,RCX,RDX,RSI,RDI,R11 are clobbered. |00000034: | ENDPROC Beep.L32: | |;; |00000034: |Exit.L32:: PROC ; Display message "End", terminate the program. |00000034:8D35[00000000] | LEA ESI,[.M:] ; String "End" will be defined in segment [.bss] at ESI. |0000003A:C706456E6400 | MOVD [ESI+0],"End" ; Dynamically define the message "End". |00000040:C746030A000000 | MOVD [ESI+3],0x0A ; LF+NUL. |00000047:E8B4FFFFFF | CALL Write.L32:: ; Display the notification "End". |0000004C:31DB | XOR EBX,EBX ; %1 Errorlevel=0. |0000004E:B801000000 | MOV EAX,1 ; Kernel service sys_exit. |00000053:CD80 | INT 0x80 ; Invoke kernel. No return to caller. |[.bss] ::::Section changed. |00000000:.............. |.M:DB 7*BYTE ; Reserve space for ASCIIZ string "End" in [.bss]. |[.text] ::::Section changed. |00000055: | ENDPROC Exit.L32: |[@LT2] ====ListLiterals in section [@LT2]. |00000000:0700 =W(0x0007) |[@LT1] ====ListLiterals in section [@LT1]. |00000000:42656570696E672E~=B"Beeping..." | |ENDPROGRAM %test | **** ListMap "t8950.obj",model=FLAT,groups=0,segments=3,entry=,stack= | [.text],FA=0000008Ch,RVA=00000000h,size=00000055h=85,width=32,align=0010h,purpose=CODE | [.rodata],FA=00000100h,RVA=00000000h,size=0000000Dh=13,width=32,align=0010h,purpose=RODATA+LITERAL | [.bss],FA=00000000h,RVA=00000000h,size=00000007h=7,width=32,align=0010h,purpose=BSS | **** ListGlobals "t8950.obj",Global=0,Public=3,Extern=0,eXport=0,Import=0 | Beep.L32,[.text]:0000001Dh,scope='P' | Exit.L32,[.text]:00000034h,scope='P' | Write.L32,[.text]:00000000h,scope='P'
Expected messages t8950.out
I0180 Assembling source file "t8950.htm". I0270 Assembling source "t8950". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t8950". "t8950.htm"{44} I0510 Assembling program pass 1. "t8950.htm"{44} I0510 Assembling program pass 2. "t8950.htm"{44} I0530 Assembling program pass 3 - final. "t8950.htm"{44} I0660 32bit FLAT COFF file "t8950.obj" created, size=609. "t8950.htm"{85} I0650 Program "t8950" assembled in 3 passes with errorlevel 0. "t8950.htm"{85} I0750 Source "t8950" (155 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t8950.htm.lst" created, size=4070. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t8950. obj
0000: 4C 01 03 00 00 00 00 00 0E 01 00 00 10 00 00 00  L··°°°°°··°°·°°°
0010: 00 00 00 01 2E 74 65 78 74 00 00 00 00 00 00 00  °°°·.text°°°°°°°
0020: 00 00 00 00 55 00 00 00 8C 00 00 00 E2 00 00 00  °°°°U°°°¤°°°¤°°°
0030: 00 00 00 00 03 00 00 00 20 00 50 60 2E 72 6F 64  °°°°·°°°¯°P`.rod
0040: 61 74 61 00 00 00 00 00 00 00 00 00 0D 00 00 00  ata°°°°°°°°°·°°°
0050: 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °·°°°°°°°°°°°°°°
0060: 40 00 50 40 2E 62 73 73 00 00 00 00 00 00 00 00  @°P@.bss°°°°°°°°
0070: 00 00 00 00 07 00 00 00 00 00 00 00 00 00 00 00  °°°°·°°°°°°°°°°°
0080: 00 00 00 00 00 00 00 00 80 00 50 C0 31 C9 31 C0  °°°°°°°°¤°P¤1¤1¤
0090: 89 F7 F7 D1 F2 AE F7 D1 B8 04 00 00 00 BB 01 00  ¤¤¤¤¤¤¤¤¤·°°°¤·°
00A0: 00 00 89 CA 89 F1 CD 80 C3 8D 35 02 00 00 00 E8  °°¤¤¤¤¤¤¤¤5·°°°¤
00B0: D8 FF FF FF 8D 35 00 00 00 00 E8 CD FF FF FF C3  ¤¤¤¤¤5°°°°¤¤¤¤¤¤
00C0: 8D 35 00 00 00 00 C7 06 45 6E 64 00 C7 46 03 0A  ¤5°°°°¤·End°¤F·¬
00D0: 00 00 00 E8 B4 FF FF FF 31 DB B8 01 00 00 00 CD  °°°¤¤¤¤¤1¤¤·°°°¤
00E0: 80 00 1F 00 00 00 04 00 00 00 06 00 2A 00 00 00  ¤°·°°°·°°°·°*°°°
00F0: 04 00 00 00 06 00 36 00 00 00 02 00 00 00 06 00  ·°°°·°6°°°·°°°·°
0100: 07 00 42 65 65 70 69 6E 67 2E 2E 2E 00 00 2E 66  ·°Beeping...°°.f
0110: 69 6C 65 00 00 00 00 00 00 00 FE FF 00 00 67 01  ile°°°°°°°¤¤°°g·
0120: 74 38 39 35 30 2E 68 74 6D 00 00 00 00 00 00 00  t8950.htm°°°°°°°
0130: 00 00 2E 62 73 73 00 00 00 00 00 00 00 00 03 00  °°.bss°°°°°°°°·°
0140: 00 00 03 01 07 00 00 00 00 00 00 00 00 00 00 00  °°···°°°°°°°°°°°
0150: 00 00 00 00 00 00 2E 72 6F 64 61 74 61 00 00 00  °°°°°°.rodata°°°
0160: 00 00 02 00 00 00 03 01 0D 00 00 00 00 00 00 00  °°·°°°···°°°°°°°
0170: 00 00 00 00 00 00 00 00 00 00 2E 74 65 78 74 00  °°°°°°°°°°.text°
0180: 00 00 00 00 00 00 01 00 00 00 03 01 55 00 00 00  °°°°°°·°°°··U°°°
0190: 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ·°°°°°°°°°°°°°°°
01A0: 00 00 04 00 00 00 02 00 00 00 02 00 0C 00 03 00  °°·°°°·°°°·°·°·°
01B0: 00 00 00 00 13 00 00 00 00 00 00 00 02 00 0D 00  °°°°·°°°°°°°·°·°
01C0: 03 00 40 4C 54 31 00 00 00 00 02 00 00 00 02 00  ·°@LT1°°°°·°°°·°
01D0: 01 01 03 00 40 4C 54 32 00 00 00 00 00 00 00 00  ···°@LT2°°°°°°°°
01E0: 02 00 01 01 03 00 00 00 00 00 1E 00 00 00 00 00  ·°···°°°°°·°°°°°
01F0: 00 00 03 00 0C 00 03 00 42 65 65 70 2E 4C 33 32  °°·°·°·°Beep.L32
0200: 1D 00 00 00 01 00 01 02 02 00 45 78 69 74 2E 4C  ·°°°·°···°Exit.L
0210: 33 32 34 00 00 00 01 00 01 02 02 00 00 00 00 00  324°°°·°···°°°°°
0220: 29 00 00 00 00 00 00 00 01 00 01 02 02 00 33 00  )°°°°°°°·°···°3°
0230: 00 00 3D 42 22 42 65 65 70 69 6E 67 2E 2E 2E 22  °°=B"Beeping..."
0240: 00 3D 57 28 30 78 30 30 30 37 29 00 45 78 69 74  °=W(0x0007)°Exit
0250: 2E 4C 33 32 2E 4D 00 57 72 69 74 65 2E 4C 33 32  .L32.M°Write.L32
0260: 00                                               °

▲Back to the top▲