Tuesday, 5 April 2016

64 bit ALP to print Hello Word

Q: Write a 64 bit ALP to print Hello word.

Assembler : NASM
Debugger : GDB
OS            : Ubuntu 14.04 LTS



Code


section .data
str: db "Hello World"    ;used to store the string
global _start
section .text
_start:
mov rax ,01        ;write system call
mov rdi ,01
mov rsi ,str
mov rdx ,11
syscall
mov rax ,60        ;exit system call
mov rdi ,00
syscall

No comments:

Post a Comment