osx/hello.asm
changeset 171 c6e0af68825a
parent 168 dfb60716880c
child 172 43ae72f88d06
--- a/osx/hello.asm
+++ b/osx/hello.asm
@@ -1,31 +1,32 @@
+global _entryPoint
+
+%define  SYSCALL_EXIT 0x1
+%define SYSCALL_WRITE 0x4
+
 section .data
     msg db "Hello World!", 0x0a ; Die Nachricht
     len equ $-msg
 
 section .text
-global entryPoint
 
-call entryPoint
+call _entryPoint
 jmp asm_exit
 
-entryPoint:
+_entryPoint:
     push dword len      ;; Länge des Texts
     push dword msg      ;; Der Text
     push dword 1        ;; stdout
 
 	;; call write
-    mov eax, 0x4
+    mov eax, SYSCALL_WRITE
     sub esp, 4
     int 0x80
 
     ;; clean up 3 pushes
     add esp, 16
-
-	ret
 	
-asm_exit:	
-    mov eax, 0x1
+asm_exit:
+	push dword 0
+    mov eax, SYSCALL_EXIT
 	sub esp, 4
     int 0x80
-
-	add esp, 4