Assembly 1


x86_64 Assembly


Packages required:

  • nasm – the Netwide Assembler, a portable 80×86 assembler
  • ld – The GNU linker (compiler)

Hello World


section .data
        text db "Hello World",10

section .text
        global _start

_start:
        mov rax, 1
        mov rdi, 1
        mov rsi, text
        mov rdx, 14
        syscall

        mov rax, 60
        mov rdi, 0
        syscall


Breakdown

text db “Hello World”,10

  • text : name of memory address
  • db : define bytes
  • 10 : new line “/n”
  • mov rax 1 : write syscall
  • mov rdi 1 : output
  • mov rdx : length
  • mov rax 60 : exit syscall
  • mov rdi 0 : input

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Comments (

0

)

%d bloggers like this: