From c8983d540d0e265fbc89a861ca7cf01be06b01f0 Mon Sep 17 00:00:00 2001 From: Shark Date: Thu, 16 Feb 2017 19:41:42 +0100 Subject: [PATCH 1/2] minor fixes --- a/assembler_nasm_linux64.asm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/a/assembler_nasm_linux64.asm b/a/assembler_nasm_linux64.asm index fd5e6afc..8d3bf4c6 100644 --- a/a/assembler_nasm_linux64.asm +++ b/a/assembler_nasm_linux64.asm @@ -3,14 +3,15 @@ section .text _start: ;tell linker entry point - xor eax,eax ; eax:=0 + xor eax,eax ;eax:=0 lea edx,[rax+len] ;message length mov al,1 ;system call number (sys_write) mov esi,msg ;message to write mov edi,eax ;file descriptor (stdout) syscall ;call kernel - mov al,60 ;system call number (sys_exit) + xor edi, edi ;return 0 (EXIT_SUCCESS) + lea eax,[rdi+60] ;system call number (sys_exit) syscall ;call kernel section .rodata From a51ab9d72c3f5e0248c21b168b242143534aa355 Mon Sep 17 00:00:00 2001 From: Shark Date: Thu, 16 Feb 2017 19:54:15 +0100 Subject: [PATCH 2/2] removed l/linux-x86.nasm, it's a duplicate of a/assembler_nasm_linux.asm --- l/linux-x86.nasm | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 l/linux-x86.nasm diff --git a/l/linux-x86.nasm b/l/linux-x86.nasm deleted file mode 100644 index 0294017a..00000000 --- a/l/linux-x86.nasm +++ /dev/null @@ -1,18 +0,0 @@ -# nasm linux-x86.nasm -o linux-x86.o -f elf && ld linux-x86.o -m elf_i386 -o linux-x86 - -section .data -msg db "Hello World", 0xa -len equ $ - msg - -section .text -global _start -_start: - mov eax, 4 - mov ebx, 1 - mov ecx, msg - mov edx, len - int 0x80 - - mov eax, 1 - mov ebx, 0 - int 0x80