Skip to content

Instantly share code, notes, and snippets.

@Chiggins
Created March 9, 2014 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chiggins/9453155 to your computer and use it in GitHub Desktop.
Save Chiggins/9453155 to your computer and use it in GitHub Desktop.
global _start
section .text
_start:
;print on screen
mov rax, 1
mov rdi, 1
mov rsi, hello_world
mov rdx, length
syscall
mov rax, var4
mov rax, [var4]
;exit gracefully
mov rax, 60
mov rdi, 11
syscall
section .data
hello_world: db 'Hello world to the SLAE-64 Course', 0xA
length: equ $-hello_world
var1: db 0x11, 0x22
var2: dw 0x3344
var3: dd 0xaabbccdd
var4: dq 0xaabbccdd11223344
repeat_buffer: times 128 db 0xAA
section .bss
buffer: resb 64
@Chiggins
Copy link
Author

Chiggins commented Mar 9, 2014

nasm -f elf64 DataTypes.nasm -o DataTypes.o
ld DataTypes.o -o DataTypes
gdb ./DataTypes
break _start
run
disassemble
info variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment