MA: hello world(32 bit)

section .data

    hello:db'Hello World',10
    hellolen:equ $-hello

section .text
    global _start
    _start:

    mov eax,4;
    mov ebx,1;
    mov ecx,hello
    mov edx,hellolen;

    int 80h

    mov     ebx,0               ;first syscall argument: exit code
       mov     eax,1               ;system call number (sys_exit)
        int     80h                ;call kernel


[apcoer@localhost ~]$ nasm -f elf64 hellwrld.asm
[apcoer@localhost ~]$ ld -o hellwrld hellwrld.o
[apcoer@localhost ~]$ ./hellwrld
Hello World

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