changeset 168 | dfb60716880c |
child 171 | c6e0af68825a |
new file mode 100644 --- /dev/null +++ b/osx/hello.asm @@ -0,0 +1,31 @@ +section .data + msg db "Hello World!", 0x0a ; Die Nachricht + len equ $-msg + +section .text +global entryPoint + +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, 0x4 + sub esp, 4 + int 0x80 + + ;; clean up 3 pushes + add esp, 16 + + ret + +asm_exit: + mov eax, 0x1 + sub esp, 4 + int 0x80 + + add esp, 4