Advertisement
pniklas

listing assembler

Sep 11th, 2020
1,907
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.      1                                  ; nasm -f elf64 demo.asm
  2.      2                                  ; ld -s -o demo demo.o
  3.      3                                  ;
  4.      4                                  
  5.      5                                  SECTION .data
  6.      6                                  
  7.      7 00000000 486F6C61206D756E64-     EatMsg: db "Hola mundo." ,10
  8.      7 00000009 6F2E0A            
  9.      8                                  EatLen: equ $-EatMsg
  10.      9                                  
  11.     10                                  SECTION .bss
  12.     11                                  
  13.     12                                  SECTION .text
  14.     13                                  
  15.     14                                  global _start
  16.     15                                  
  17.     16                                  _start:
  18.     17 00000000 90                          nop
  19.     18 00000001 B804000000                  mov eax, 4  ; Imprimir texto
  20.     19 00000006 BB02000000                  mov ebx, 2  ; Por cual FD
  21.     20 0000000B B9[00000000]                mov ecx, EatMsg
  22.     21 00000010 BA0C000000                  mov edx, EatLen
  23.     22                                  llamada1:
  24.     23 00000015 CD80                        int 80H     ;Invoco kernel
  25.     24                                  
  26.     25 00000017 B801000000                  mov eax, 1  ;Salgo
  27.     26 0000001C BB18000000                  mov ebx, 24     ;RC=0
  28.     27                                  llamada2:
  29.     28 00000021 CD80                        int 80H     ;Invoco kernel
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement