flat assembler
Message board for the users of flat assembler.
Index
> Linux > Linux 64 FASM coding |
Author |
|
Feryno 23 Apr 2006, 09:54
Hello, hot and necessary package for every Linux64 Flat Assembler coder.
One big please to Tomasz Grysztar - would you update Hello64 sample, please? The way of asm coding in memory over old 32-bit limit is by syscall, but not int80 because int80 isn't able to access memory over 32-bit (maybe truncate 64-bit reg to 32-bit ?) Of course int80 works perfectly up to 32-bit memory limit. Code: ; fasm demonstration of writing 64-bit ELF executable ; syscall numbers: /usr/src/linux/include/asm-x86_64/unistd.h ; parameters order: ; r9 ; 6th param ; r8 ; 5th param ; r10 ; 4th param ; rdx ; 3rd param ; rsi ; 2nd param ; rdi ; 1st param ; eax ; syscall_number ; syscall format ELF64 executable at 0000000100000000h ; put image over 32-bit limit segment readable executable entry $ mov edx,msg_size ; CPU zero extends 32-bit operation to 64-bit ; we can use less bytes than in case mov rdx,... lea rsi,[msg] mov edi,1 ; STDOUT mov eax,1 ; sys_write syscall xor edi,edi ; exit code 0 mov eax,60 ; sys_exit syscall segment readable writeable msg db 'Hello 64-bit world!',0xA msg_size = $-msg
|
|||||||||||
23 Apr 2006, 09:54 |
|
Feryno 28 Apr 2006, 11:21
and here debugger for fasm coding under Linux64
http://board.flatassembler.net/topic.php?p=38108#38108 |
|||
28 Apr 2006, 11:21 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.