osx/hello.asm
changeset 168 dfb60716880c
child 171 c6e0af68825a
equal deleted inserted replaced
167:7c6b221900bf 168:dfb60716880c
       
     1 section .data
       
     2     msg db "Hello World!", 0x0a ; Die Nachricht
       
     3     len equ $-msg
       
     4 
       
     5 section .text
       
     6 global entryPoint
       
     7 
       
     8 call entryPoint
       
     9 jmp asm_exit
       
    10 
       
    11 entryPoint:
       
    12     push dword len      ;; Länge des Texts
       
    13     push dword msg      ;; Der Text
       
    14     push dword 1        ;; stdout
       
    15 
       
    16 	;; call write
       
    17     mov eax, 0x4
       
    18     sub esp, 4
       
    19     int 0x80
       
    20 
       
    21     ;; clean up 3 pushes
       
    22     add esp, 16
       
    23 
       
    24 	ret
       
    25 	
       
    26 asm_exit:	
       
    27     mov eax, 0x1
       
    28 	sub esp, 4
       
    29     int 0x80
       
    30 
       
    31 	add esp, 4