osx/hello.asm
author Markus Bröker<broeker.markus@googlemail.com>
Sat, 21 Oct 2017 13:45:05 +0200
changeset 171 c6e0af68825a
parent 168 dfb60716880c
child 172 43ae72f88d06
permissions -rw-r--r--
Entrypoint and RET fixed

global _entryPoint

%define  SYSCALL_EXIT 0x1
%define SYSCALL_WRITE 0x4

section .data
    msg db "Hello World!", 0x0a ; Die Nachricht
    len equ $-msg

section .text

call _entryPoint
jmp asm_exit

_entryPoint:
    push dword len      ;; Länge des Texts
    push dword msg      ;; Der Text
    push dword 1        ;; stdout

	;; call write
    mov eax, SYSCALL_WRITE
    sub esp, 4
    int 0x80

    ;; clean up 3 pushes
    add esp, 16
	
asm_exit:
	push dword 0
    mov eax, SYSCALL_EXIT
	sub esp, 4
    int 0x80