Guest User

Untitled

a guest
Feb 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bits 64
  2. section .data
  3.     big_endian db "big endian", 0xA
  4.     little_endian db "little endian", 0xA
  5.     len1 equ $ - big_endian
  6.     len2 equ $ - big_endian
  7.  
  8. section .text
  9. global _start
  10. _start:
  11.     mov word ds:[3000], 0x1A3C
  12.     mov ax, word ds:[3000]
  13.     mov rax, 4
  14.     mov rbx, 1
  15.     cmp al, 0x3C
  16.     je big
  17.     cmp al, 0x1A
  18.     jne little
  19.     big:
  20.         lea rcx, big_endian
  21.         lea rdx, len1
  22.         int 0x80
  23.         jmp end_program
  24.     little:
  25.         mov rcx, little_endian
  26.         mov rdx, len2
  27.         int 0x80
  28.         jmp end_program
  29.  
  30.     end_program:
  31.         mov rbx, 0
  32.         mov rax, 1
  33.         int 0x80
Add Comment
Please, Sign In to add comment