Advertisement
LincolnArantes

Printando com esp e byte uma palavra

Oct 27th, 2018
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Este código usa o esp e byte como exemplo
  2. ;Lincoln Cesar dos Reis Arantes
  3.  
  4. global _start
  5.  
  6. _start:
  7.     sub esp, 7
  8.     mov [esp], byte 'L'
  9.     mov [esp+1], byte 'i'
  10.     mov [esp+2], byte 'n'
  11.     mov [esp+3], byte 'c'
  12.     mov [esp+4], byte 'o'
  13.     mov [esp+5], byte 'l'
  14.     mov [esp+6], byte 'n'
  15.    
  16.    
  17.     ;printa na tela o esp
  18.     mov eax, 4    ; sys_write system call
  19.     mov ebx, 1    ; stdout file descriptor
  20.     mov ecx, esp  ; bytes to write
  21.     mov edx, 7    ; number of bytes to write
  22.     int 0x80      ; perform system call
  23.    
  24.    
  25.     mov eax, 1    ; sys_exit
  26.     mov ebx, 0    ; exit
  27.     int 0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement