summaryrefslogtreecommitdiff
path: root/nasm/helloworld.asm
diff options
context:
space:
mode:
Diffstat (limited to 'nasm/helloworld.asm')
-rwxr-xr-xnasm/helloworld.asm17
1 files changed, 17 insertions, 0 deletions
diff --git a/nasm/helloworld.asm b/nasm/helloworld.asm
new file mode 100755
index 0000000..3016f58
--- /dev/null
+++ b/nasm/helloworld.asm
@@ -0,0 +1,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