Advertisement
LincolnArantes

Junta duas palavras e printa na tela

Oct 30th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Este código junta duas palavras e printa na tela
  2. ;Escrito por Lincoln Cesar dos Reis Arantes
  3.  
  4. global _start
  5.  
  6. _start:
  7.     call funcao ;chama a função
  8.    
  9.     ;final
  10.     mov eax, 1
  11.     mov ebx, 0
  12.     int 0x80
  13.  
  14. funcao:
  15.     push ebp
  16.     mov ebp, esp
  17.     sub esp, 4
  18.     mov [esp], dword'Bala' ;só 4 bytes
  19.     mov [esp+4], dword'-boa' ;só 4 bytes
  20.    
  21.  
  22.        ; printa os dados na tela corretamente
  23.    
  24.     mov eax, 4    ; sys_write system call
  25.     mov ebx, 1    ; stdout file descriptor
  26.     mov ecx, esp  ; bytes to write
  27.     mov edx, 8    ; number of bytes to write  4 default
  28.     int 0x80      ; perform system call
  29.  
  30.     mov esp, ebp
  31.     pop ebp
  32.     ret ;retorno
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement