MA: (hello world alike) 64-bit

section .data:
    input:db'Parashar',10
    inputLen: equ $-input

section .text
    global _start
    _start:
   
    mov rax,1
    mov rdi,1
    mov rsi,input
    mov rdx,inputLen

    syscall

    mov rax,60                ; The system call for exit (sys_exit)
     mov rbx,0                ; Exit with return code of 0 (no error)
     syscall  

[apcoer@localhost ~]$ nasm -f elf64 parashar.asm
[apcoer@localhost ~]$ ld -o parashar parashar.o
[apcoer@localhost ~]$ ./parashar
Parashar

Comments

Popular posts from this blog

NASM: program to find largest number from an array of 32-bit numbers(hard-coded)

Rules for drawing a FLOWCHART