Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  ; Program som skriver ut Hello World
  2.  ; Konstanter
  3.    lf equ 10      ; Linjeskift
  4.  ; section .data     ; Datasegment
  5.    ; melding db 'Hello World!',lf
  6.    ; lengde equ $ - melding
  7.  section .text      ; Kodesegment
  8.  global _start
  9.  _start:
  10.     mov    ecx,0x0 ; a = 0
  11.     mov    eax,0x0
  12.     jmp    _start+0x33
  13.     cmp    eax,0x9
  14.     jg     $+0x2
  15.     add    ecx,0x1
  16.     jmp    _start+0x2f
  17.     sub    ecx,0x1
  18.     add    eax,0x1
  19.     cmp    eax,0x13
  20.     jle    _start+0x1f
  21.  
  22.     mov edx,1 ;length is always 1
  23.     add ecx,'0'     ; convert number to ascii
  24.     mov ebx,1
  25.     mov eax,4       ; sys_write
  26.     int 80h         ; interrupt 128
  27.     mov ebx,0
  28.     mov eax,1       ; sys_exit
  29.     int 80h         ; interrupt 128
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement