Advertisement
LincolnArantes

Brincando com db

Dec 10th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Brincando com db
  2. ;Lincoln Cesar dos Reis Arantes
  3. ;https://www.tutorialspoint.com/compile_assembly_online.php
  4.  
  5. section .text
  6.     global _start       ;must be declared for using gcc
  7. _start:                     ;tell linker entry point
  8.     mov edx, len    ;message length
  9.     mov ecx, msg    ;message to write
  10.     mov ebx, 1      ;file descriptor (stdout)
  11.     mov eax, 4      ;system call number (sys_write)
  12.     int 0x80        ;call kernel
  13.    
  14.    
  15.    
  16.    
  17.       ; mostrando o resultado
  18.    mov eax, 4      
  19.    mov ebx, 1
  20.    mov ecx, varent0      
  21.    mov edx, 9        
  22.    int 0x80
  23.    
  24.        
  25.       ; mostrando o resultado
  26.    mov eax, 4      
  27.    mov ebx, 1
  28.    mov ecx, varent1    
  29.    mov edx, 9        
  30.    int 0x80
  31.    
  32.    
  33.        
  34.       ; mostrando o resultado
  35.    mov eax, 4      
  36.    mov ebx, 1
  37.    mov ecx, varent2      
  38.    mov edx, 9        
  39.    int 0x80
  40.    
  41.    
  42.        
  43.       ; mostrando o resultado
  44.    mov eax, 4      
  45.    mov ebx, 1
  46.    mov ecx, varent3      
  47.    mov edx, 9        
  48.    int 0x80
  49.    
  50.    
  51.        
  52.       ; mostrando o resultado
  53.    mov eax, 4      
  54.    mov ebx, 1
  55.    mov ecx, varent4      
  56.    mov edx, 9        
  57.    int 0x80
  58.    
  59.    
  60.    
  61.    
  62.     mov eax, 1      ;system call number (sys_exit)
  63.     int 0x80        ;call kernel
  64.  
  65. section .data
  66.  
  67.  
  68. varent0 db 'conteudo0'
  69. varent1 db 'conteudo1'
  70. varent2 db 'conteudo2'
  71. varent3 db 'conteudo3'
  72. varent4 db 'conteudo4'
  73.  
  74. msg db  'Mostrando as variaveis',0xa    ;our dear string
  75. len equ $ - msg         ;length of our dear string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement