Advertisement
Guest User

Untitled

a guest
Jun 8th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. section .data
  2.    numb  db 4
  3.    lc db 5
  4.  
  5. section  .bss
  6.    valami   resb  10
  7.  
  8. section .text
  9.    global _start     ;must be declared for linker (ld)
  10.    
  11. _start:             ;tells linker entry point
  12.  
  13.    add dword[numb],'0'
  14.    
  15.    ;push exit    
  16.    
  17.  
  18.    mov   ecx,4       ; loop count
  19. quattro:
  20.    push  ecx
  21.    
  22.    ; print nr4
  23.    mov   edx,1
  24.    mov   ecx,numb
  25.    mov   ebx,1
  26.    mov   eax,4
  27.    int   0x80
  28.    
  29.    pop   ecx
  30.    dec   ecx
  31.    cmp   ecx,0
  32.    jne   quattro
  33.    
  34.  
  35.  
  36. input:
  37.    mov   edx,10
  38.    mov   ecx,valami
  39.    mov   ebx,0
  40.    mov   eax,3
  41.    int   0x80
  42.      
  43.    mov   ebx,1
  44.    mov   eax,4
  45.    int   0x80
  46.  
  47. exit:
  48.    mov  eax,1       ;system call number (sys_exit)
  49.    int  0x80        ;call kernel
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement