Advertisement
LincolnArantes

Untitled

Oct 13th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; A macro with two parameters
  2. ; Implements the write system call
  3.    %macro write_string 2
  4.       mov   eax, 4
  5.       mov   ebx, 1
  6.       mov   ecx, %1
  7.       mov   edx, %2
  8.       int   80h
  9.    %endmacro
  10.  
  11.  
  12.  
  13. section .text
  14.    global _start     ;must be declared for linker (gcc)
  15.    
  16. _start:          ;tell linker entry point
  17.  
  18.  
  19.  
  20.     ; macros-------inicio
  21.    
  22.    
  23.  ; ----macro mensage antes dos nome do programa
  24.   write_string msg1, len1
  25.   ;--------------------------
  26.  
  27.   ;---nome do programa
  28.    write_string msg6, len6  
  29.    ;----- fim nome do programa
  30.    
  31.    
  32.     ;-----macros message depois do nome do programa
  33.      write_string msg2, len2  
  34.      ;------ fim macro message depois do nome do programa
  35.    
  36.    
  37.    write_string msg3, len3              
  38.    write_string msg4, len4    
  39.    write_string msg5, len5
  40.     ; macros ------- fim
  41.  
  42.    
  43.    mov  eax,1    ;system call number (sys_exit)
  44.    int  0x80     ;call kernel
  45.    
  46. section .data
  47.  
  48.  
  49.  
  50. msg1 db '----------------------------------------',0xA,0xD  
  51. len1 equ $ - msg1
  52.  
  53. ;------nome do programa
  54. msg6 db 'Sistema codorna - Descobrimento de dados',0xA,0xD  
  55. len6 equ $ - msg6
  56.  
  57. ;------fim nome do programa
  58.  
  59.  
  60.  
  61. msg2 db '----------------------------------------',0xA,0xD  
  62. len2 equ $ - msg2
  63.  
  64.  
  65.  
  66. ;--------inicio macros mensagens
  67.  
  68.  
  69. msg3 db 'Seja bem vindo ao sistema!',0xA,0xD    
  70. len3 equ $ - msg3          
  71.  
  72. msg4 db 'Welcome to the world of,', 0xA,0xD
  73. len4 equ $- msg4
  74.  
  75. msg5 db 'Linux assembly programming! '
  76. len5 equ $- msg5
  77.  
  78. ;----- fim messages de macro
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement