Skip to content

Instantly share code, notes, and snippets.

@aagontuk
Last active November 3, 2024 18:09
Show Gist options
  • Save aagontuk/177947659828c1fe6611d4971bfddd27 to your computer and use it in GitHub Desktop.
Save aagontuk/177947659828c1fe6611d4971bfddd27 to your computer and use it in GitHub Desktop.
Resources on x86_64 ISA

x86_64 Assembly Resources

Tools

Assembly

section .text
  global _start

_start:
  inc rdi

create object file: nasm -f elf64 -o test.o test.asm

link to make executable (dynamically linked with c std lib): ld -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o test test.o -lc

Using GNU as:

as test.asm -o test.o

Disassembly

objdump: objdump -D -Mintel,x86-64 -b binary -m i386 jit.bin

nasm: ndisasm -b 64 jit.bin

Notes

  • Registers to pass parameters: rdi, rsi, rdx, rcx, r8, r9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment