EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t9750: ELF object module for 64bit Linux


Source & expected listing t9750.htm.lst
| | EUROASM AUTOSEGMENT=ON,CPU=x64,DUMPWIDTH=28 |7439373530 |%test %SET t9750 |00000000: | | |%test PROGRAM FORMAT=ELF,MODEL=FLAT,WIDTH=64 |[.text] ::::Section changed. |00000000: |Write.L64:: PROC ; Display ASCIIZ string pointed to by RSI using 64bit Linux. |00000000:31C9 | XOR ECX,ECX ; Clear RCX to keep the size of input string. |00000002:31C0 | XOR EAX,EAX ; Clear AL, the searched terminating character |00000004:4889F7 | MOV RDI,RSI ; %2 String address in RSI,RDI. |00000007:48F7D1 | NOT RCX ; Assume unlimited possible string size. |0000000A:F2AE | REPNE SCASB ; Find the zero terminator. |0000000C:48F7D1 | NOT RCX ; Get string size to RCX. |0000000F:B801000000 | MOV RAX,1 ; Kernel service sys_write. |00000014:BF01000000 | MOV RDI,1 ; %1 I/O handle STDOUT_FILENO. |00000019:89CA | MOV EDX,ECX ; %3 String size. |0000001B:0F05 | SYSCALL ; Invoke kernel. |0000001D:C3 | RET ; Return to caller. RAX,RCX,RDX,RSI,RDI,R11 are clobbered. |0000001E: | ENDPROC Write.L64: | |;; |0000001E: |Beep.L64:: PROC ; Display message "Beeping.." and play a sound using 64bit Linux. |0000001E:488D35(00000000) | LEA RSI,[=B"Beeping..."] ; Define a literal string in [.rodata]. |00000025:E8D6FFFFFF | CALL Write.L64:: ; Display the notification "Beeping...". |0000002A:488D35(00000000) | LEA RSI,[=W(0x0007)] ; Define ASCIIZ string with BEL character in [.rodata]. |00000031:E8CAFFFFFF | CALL Write.L64:: ; Play the beep sound. |00000036:C3 | RET ; Return to caller. RAX,RCX,RDX,RSI,RDI,R11 are clobbered. |00000037: | ENDPROC Beep.L64: | |;; |00000037: |Exit.L64:: PROC ; Display message "End", terminate the program. |00000037:488D35(00000000) | LEA RSI,[.M:] ; String "End" will be defined in segment [.bss] at RSI. |0000003E:C706456E6400 | MOVD [RSI+0],"End" ; Dynamically define the message "End". |00000044:C746030A000000 | MOVD [RSI+3],0x0A ; LF+NUL. |0000004B:E8B0FFFFFF | CALL Write.L64:: ; Display the notification "End". |00000050:31FF | XOR EDI,EDI ; %1 Errorlevel=0. |00000052:B83C000000 | MOV RAX,60 ; Kernel service sys_exit. |00000057:0F05 | SYSCALL ; 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. |00000059: | ENDPROC Exit.L64: |[@LT2] ====ListLiterals in section [@LT2]. |00000000:0700 =W(0x0007) |[@LT1] ====ListLiterals in section [@LT1]. |00000000:42656570696E672E~=B"Beeping..." | |ENDPROGRAM %test | **** ListMap "t9750.o",model=FLAT,groups=0,segments=8,entry=,stack= | [],FA=00000000h,RVA=00000000h,size=00000000h=0,width=0,align=0,purpose= | [.symtab],FA=00000240h,RVA=00000000h,size=00000168h=360,width=0,align=8,purpose=SYMBOLS | [.rela.text],FA=000003A8h,RVA=00000000h,size=00000048h=72,width=0,align=8,purpose=RELOC | [.strtab],FA=000003F0h,RVA=00000000h,size=00000079h=121,width=0,align=1,purpose=STRINGS | [.shstrtab],FA=00000469h,RVA=00000000h,size=00000039h=57,width=0,align=1,purpose=STRINGS | [.text],FA=000004B0h,RVA=00000000h,size=00000059h=89,width=64,align=0010h,purpose=CODE | [.rodata],FA=00000510h,RVA=00000000h,size=0000000Dh=13,width=64,align=0010h,purpose=RODATA+LITERAL | [.bss],FA=00000520h,RVA=00000000h,size=00000007h=7,width=64,align=0010h,purpose=BSS | **** ListGlobals "t9750.o",Global=0,Public=3,Extern=0,eXport=0,Import=0 | Beep.L64,[.text]:0000001Eh,scope='P' | Exit.L64,[.text]:00000037h,scope='P' | Write.L64,[.text]:00000000h,scope='P'
Expected messages t9750.out
I0180 Assembling source file "t9750.htm". I0270 Assembling source "t9750". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t9750". "t9750.htm"{44} I0510 Assembling program pass 1. "t9750.htm"{44} I0510 Assembling program pass 2. "t9750.htm"{44} I0530 Assembling program pass 3 - final. "t9750.htm"{44} I0660 64bit FLAT ELF file "t9750.o" created, size=1309. "t9750.htm"{84} I0650 Program "t9750" assembled in 3 passes with errorlevel 0. "t9750.htm"{84} I0750 Source "t9750" (202 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t9750.htm.lst" created, size=4485. I0990 EuroAssembler terminated with errorlevel 0.
Expected output file t9750. o
0000: 7F 45 4C 46 02 01 01 00 00 00 00 00 00 00 00 00  ¤ELF···°°°°°°°°°
0010: 01 00 3E 00 01 00 00 00 00 00 00 00 00 00 00 00  ·°>°·°°°°°°°°°°°
0020: 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00  °°°°°°°°@°°°°°°°
0030: 00 00 00 00 40 00 38 00 00 00 40 00 08 00 04 00  °°°°@°8°°°@°·°·°
0040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0080: 01 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00  ·°°°·°°°°°°°°°°°
0090: 00 00 00 00 00 00 00 00 40 02 00 00 00 00 00 00  °°°°°°°°@·°°°°°°
00A0: 68 01 00 00 00 00 00 00 03 00 00 00 0C 00 00 00  h·°°°°°°·°°°·°°°
00B0: 08 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00  ·°°°°°°°·°°°°°°°
00C0: 09 00 00 00 04 00 00 00 02 00 00 00 00 00 00 00  ·°°°·°°°·°°°°°°°
00D0: 00 00 00 00 00 00 00 00 A8 03 00 00 00 00 00 00  °°°°°°°°¤·°°°°°°
00E0: 48 00 00 00 00 00 00 00 01 00 00 00 05 00 00 00  H°°°°°°°·°°°·°°°
00F0: 08 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00  ·°°°°°°°·°°°°°°°
0100: 14 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00  ·°°°·°°°°°°°°°°°
0110: 00 00 00 00 00 00 00 00 F0 03 00 00 00 00 00 00  °°°°°°°°¤·°°°°°°
0120: 79 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  y°°°°°°°°°°°°°°°
0130: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ·°°°°°°°°°°°°°°°
0140: 1C 00 00 00 03 00 00 00 00 00 00 00 00 00 00 00  ·°°°·°°°°°°°°°°°
0150: 00 00 00 00 00 00 00 00 69 04 00 00 00 00 00 00  °°°°°°°°i·°°°°°°
0160: 39 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  9°°°°°°°°°°°°°°°
0170: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ·°°°°°°°°°°°°°°°
0180: 26 00 00 00 01 00 00 00 06 00 00 00 00 00 00 00  &°°°·°°°·°°°°°°°
0190: 00 00 00 00 00 00 00 00 B0 04 00 00 00 00 00 00  °°°°°°°°¤·°°°°°°
01A0: 59 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  Y°°°°°°°°°°°°°°°
01B0: 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ·°°°°°°°°°°°°°°°
01C0: 2C 00 00 00 01 00 00 00 02 00 00 00 00 00 00 00  ,°°°·°°°·°°°°°°°
01D0: 00 00 00 00 00 00 00 00 10 05 00 00 00 00 00 00  °°°°°°°°··°°°°°°
01E0: 0D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ·°°°°°°°°°°°°°°°
01F0: 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ·°°°°°°°°°°°°°°°
0200: 34 00 00 00 08 00 00 00 03 00 00 00 00 00 00 00  4°°°·°°°·°°°°°°°
0210: 00 00 00 00 00 00 00 00 20 05 00 00 00 00 00 00  °°°°°°°°¯·°°°°°°
0220: 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ·°°°°°°°°°°°°°°°
0230: 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ·°°°°°°°°°°°°°°°
0240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0250: 00 00 00 00 00 00 00 00 01 00 00 00 04 00 F1 FF  °°°°°°°°·°°°·°¤¤
0260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
0270: 0B 00 00 00 03 00 07 00 00 00 00 00 00 00 00 00  ·°°°·°·°°°°°°°°°
0280: 00 00 00 00 00 00 00 00 10 00 00 00 03 00 06 00  °°°°°°°°·°°°·°·°
0290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
02A0: 18 00 00 00 03 00 03 00 00 00 00 00 00 00 00 00  ·°°°·°·°°°°°°°°°
02B0: 00 00 00 00 00 00 00 00 20 00 00 00 03 00 01 00  °°°°°°°°¯°°°·°·°
02C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  °°°°°°°°°°°°°°°°
02D0: 28 00 00 00 03 00 05 00 00 00 00 00 00 00 00 00  (°°°·°·°°°°°°°°°
02E0: 00 00 00 00 00 00 00 00 2E 00 00 00 01 00 06 00  °°°°°°°°.°°°·°·°
02F0: 02 00 00 00 00 00 00 00 0B 00 00 00 00 00 00 00  ·°°°°°°°·°°°°°°°
0300: 3D 00 00 00 01 00 06 00 00 00 00 00 00 00 00 00  =°°°·°·°°°°°°°°°
0310: 02 00 00 00 00 00 00 00 48 00 00 00 00 00 06 00  ·°°°°°°°H°°°°°·°
0320: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ·°°°°°°°°°°°°°°°
0330: 4D 00 00 00 00 00 06 00 00 00 00 00 00 00 00 00  M°°°°°·°°°°°°°°°
0340: 00 00 00 00 00 00 00 00 52 00 00 00 01 00 07 00  °°°°°°°°R°°°·°·°
0350: 00 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00  °°°°°°°°·°°°°°°°
0360: 5D 00 00 00 12 00 05 00 1E 00 00 00 00 00 00 00  ]°°°·°·°·°°°°°°°
0370: 19 00 00 00 00 00 00 00 66 00 00 00 12 00 05 00  ·°°°°°°°f°°°·°·°
0380: 37 00 00 00 00 00 00 00 22 00 00 00 00 00 00 00  7°°°°°°°"°°°°°°°
0390: 6F 00 00 00 12 00 05 00 00 00 00 00 00 00 00 00  o°°°·°·°°°°°°°°°
03A0: 1E 00 00 00 00 00 00 00 21 00 00 00 00 00 00 00  ·°°°°°°°!°°°°°°°
03B0: 02 00 00 00 03 00 00 00 FE FF FF FF FF FF FF FF  ·°°°·°°°¤¤¤¤¤¤¤¤
03C0: 2D 00 00 00 00 00 00 00 02 00 00 00 03 00 00 00  -°°°°°°°·°°°·°°°
03D0: FC FF FF FF FF FF FF FF 3A 00 00 00 00 00 00 00  ¤¤¤¤¤¤¤¤:°°°°°°°
03E0: 02 00 00 00 02 00 00 00 FC FF FF FF FF FF FF FF  ·°°°·°°°¤¤¤¤¤¤¤¤
03F0: 00 74 39 37 35 30 2E 68 74 6D 00 2E 62 73 73 00  °t9750.htm°.bss°
0400: 2E 72 6F 64 61 74 61 00 2E 73 74 72 74 61 62 00  .rodata°.strtab°
0410: 2E 73 79 6D 74 61 62 00 2E 74 65 78 74 00 3D 42  .symtab°.text°=B
0420: 22 42 65 65 70 69 6E 67 2E 2E 2E 22 00 3D 57 28  "Beeping..."°=W(
0430: 30 78 30 30 30 37 29 00 40 4C 54 31 00 40 4C 54  0x0007)°@LT1°@LT
0440: 32 00 45 78 69 74 2E 4C 36 34 2E 4D 00 42 65 65  2°Exit.L64.M°Bee
0450: 70 2E 4C 36 34 00 45 78 69 74 2E 4C 36 34 00 57  p.L64°Exit.L64°W
0460: 72 69 74 65 2E 4C 36 34 00 00 2E 73 79 6D 74 61  rite.L64°°.symta
0470: 62 00 2E 72 65 6C 61 2E 74 65 78 74 00 2E 73 74  b°.rela.text°.st
0480: 72 74 61 62 00 2E 73 68 73 74 72 74 61 62 00 2E  rtab°.shstrtab°.
0490: 74 65 78 74 00 2E 72 6F 64 61 74 61 00 2E 62 73  text°.rodata°.bs
04A0: 73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  s°°°°°°°°°°°°°°°
04B0: 31 C9 31 C0 48 89 F7 48 F7 D1 F2 AE 48 F7 D1 B8  1¤1¤H¤¤H¤¤¤¤H¤¤¤
04C0: 01 00 00 00 BF 01 00 00 00 89 CA 0F 05 C3 48 8D  ·°°°¤·°°°¤¤··¤H¤
04D0: 35 00 00 00 00 E8 D6 FF FF FF 48 8D 35 00 00 00  5°°°°¤¤¤¤¤H¤5°°°
04E0: 00 E8 CA FF FF FF C3 48 8D 35 00 00 00 00 C7 06  °¤¤¤¤¤¤H¤5°°°°¤·
04F0: 45 6E 64 00 C7 46 03 0A 00 00 00 E8 B0 FF FF FF  End°¤F·¬°°°¤¤¤¤¤
0500: 31 FF B8 3C 00 00 00 0F 05 00 00 00 00 00 00 00  1¤¤<°°°··°°°°°°°
0510: 07 00 42 65 65 70 69 6E 67 2E 2E 2E 00           ·°Beeping...°

▲Back to the top▲