Answers for "Write a 64-bit program in assembly that prints Hello, world in .asm"

C
0

Write a 64-bit program in assembly that prints Hello, world in .asm

; ----------------------------------------------------------------------------------------; Writes "Hello, World" to the console using only system calls. Runs on 64-bit Linux only.; To assemble and run:;;     nasm -felf64 hello.asm && ld hello.o && ./a.out; ----------------------------------------------------------------------------------------          global    _start          section   .text_start:   mov       rax, 1                  ; system call for write          mov       rdi, 1                  ; file handle 1 is stdout          mov       rsi, message            ; address of string to output          mov       rdx, 13                 ; number of bytes          syscall                           ; invoke operating system to do the write          mov       rax, 60                 ; system call for exit          xor       rdi, rdi                ; exit code 0          syscall                           ; invoke operating system to exit          section   .datamessage:  db        "Hello, World", 10      ; note the newline at the end
Posted by: Guest on July-30-2021

Code answers related to "Write a 64-bit program in assembly that prints Hello, world in .asm"

Code answers related to "C"

Browse Popular Code Answers by Language