Advertisement
LincolnArantes

Incrementa valor simples

Oct 19th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Escrito por Lincoln Cesar dos Reis Arantes
  2.  
  3.  
  4. ; incrementa valores - funciona bem se o incremento for ate 9
  5.  
  6.  
  7. section .text
  8.  
  9. global _start
  10.  
  11. _start:
  12.  
  13.    
  14.  
  15.     mov  eax, '3'; move o valor que vai ser incrementado para o registrador eax
  16.    
  17.     inc  eax  ; incrementa 1 no valor acima
  18.  
  19.     mov     [incrementa], eax ;pega o resultado do incremento e joga na variavel incrementa
  20.  
  21.  
  22. ;---------------printa o valor na tela
  23.     mov     ecx, incrementa
  24.     mov     edx, 2 ;default 1
  25.     mov     ebx, 1
  26.     mov     eax, 4
  27.     int     0x80
  28.  
  29.     mov     eax, 1
  30.     int     0x80
  31.  
  32.  
  33.  
  34. segment .bss
  35.  
  36.     incrementa resb 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement