summaryrefslogtreecommitdiff
path: root/nasm/helloworld.asm
blob: 3016f58bb3956dc42673394009c15cceba8b99e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
SECTION .data
msg     db     "Hello World!", 0Ah  ;

SECTION .text
global _start

_start:

        mov     edx, 13     ; number of bytes to write
        mov     ecx, msg    ; move memory address of 'msg' to ecx
        mov     ebx, 1      ; write to the file STDOUT
        mov     eax, 4      ; invoke SYS_WRITE (kernel opcode 4)
        int     80h

        mov     ebx, 0      ;
        mov     eax, 1      ;
        int     80h