Advertisement
Narayan

Untitled

Jun 28th, 2014
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. section .data
  2.     hello:     db 'Hello world!',10    ; 'Hello world!' plus a linefeed character
  3.     helloLen:  equ $-hello             ; Length of the 'Hello world!' string
  4.                                        ; (I'll explain soon)
  5.  
  6. section .text
  7.     global _start
  8.  
  9. _start:
  10.     mov eax,4            ; The system call for write (sys_write)
  11.     mov ebx,1            ; File descriptor 1 - standard output
  12.     mov ecx,hello        ; Put the offset of hello in ecx
  13.     mov edx,helloLen     ; helloLen is a constant, so we don't need to say
  14.                          ;  mov edx,[helloLen] to get it's actual value
  15.     int 80h              ; Call the kernel
  16.  
  17.     mov eax,1            ; The system call for exit (sys_exit)
  18.     mov ebx,0            ; Exit with return code of 0 (no error)
  19.     int 80h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement