From: Holger H. <ha...@gm...> - 2009-08-19 08:49:08
|
On Tue, 18 Aug 2009 21:19:21 +0200 Holger Hanrath <ha...@gm...> wrote: here is the program what that does what i want in native x86_64: ; write 3 bytes from argv[0] to stdout ; syscall numbers from asm/unistd_64.h stdout equ 1 write equ 1 exit equ 60 section .text global _start _start: pop rax ; rax = argc pop rax ; rax = argv[0] ; place the length of the string in RDX mov rdx, 3 ; write 3 bytes ; print the string using write() system call mov rsi, rax ; write needs the address of the string in rsi mov rdi, stdout mov rax, write syscall ; exit from the application here xor rdi, rdi ; return 0 mov rax, exit syscall |