Advertisement
LincolnArantes

Soma simples e util

Oct 19th, 2018
148
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. ; soma valores fixados
  5.  
  6.  
  7. section .text
  8.  
  9. global _start
  10.  
  11. _start:
  12.  
  13.    
  14.  
  15.     mov  eax, '3'; move para o registrador o numero que vai ser somado
  16.     sub  eax, '0'
  17.     mov  ebx, '2'; move para o registrador o numero que vai ser somando
  18.     sub  ebx, '0'
  19.     add eax, ebx
  20.     add eax, '0'
  21.  
  22.     mov     [soma], eax ;pega o resultado e joga na variavel soma
  23.  
  24. ;---------------printa o valor na tela
  25.     mov     ecx, soma
  26.     mov     edx, 2 ;default 1
  27.     mov     ebx, 1
  28.     mov     eax, 4
  29.     int     0x80
  30.  
  31.     mov     eax, 1
  32.     int     0x80
  33.  
  34.  
  35.  
  36. segment .bss
  37.  
  38.     soma resb 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement