Skip to content

HarshKapadia2/assembly

Repository files navigation

Assembly

Compilation and Execution Instructions

# Use Netwide Assembler to compile assembly code to object file
$ nasm -f elf32 hello-world.asm -o hello-world.o

# Use GNU Linker to link object file and create an ELF (executable)
$ ld -m elf_i386 hello-world.o -o hello-world

# Execute the ELF
$ ./hello-world

Register Sizes

  • 8-bit
    • AH, AL
  • 16-bit
    • AX (AH:AL)
  • 32-bit
    • EAX
  • 64-bit
    • RAX

Data Sizes

  • db or byte
    • One byte
  • dw or word
    • One word, i.e., two bytes
  • dd or dword
    • Double word, i.e., four bytes
  • dq or qword
    • Quadruple word, i.e., eight bytes

Useful Commands

  • file
  • nm
  • ldd
  • objdump
  • strace
  • readelf
  • gdb
  • gf

Resources

About

Assembly language knowledgebase.

Topics

Resources

License

Stars

Watchers

Forks