Merge pull request #385 from Shark64/master

Remove duplicate nasm version, minor fixes to the linux64-nasm
This commit is contained in:
Mike Donaghy
2017-02-19 09:40:00 -06:00
committed by GitHub
2 changed files with 3 additions and 20 deletions

View File

@@ -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

View File

@@ -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