From d98f46ce647846b0aa30b2e16a30fd4e152a1bf5 Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Thu, 10 Jul 2025 22:55:07 +0200 Subject: Add new code Signed-off-by: Carlos Maiolino --- PGU/CHAP8/helloworld-nolib.s | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 PGU/CHAP8/helloworld-nolib.s (limited to 'PGU/CHAP8/helloworld-nolib.s') diff --git a/PGU/CHAP8/helloworld-nolib.s b/PGU/CHAP8/helloworld-nolib.s new file mode 100644 index 0000000..83d52ce --- /dev/null +++ b/PGU/CHAP8/helloworld-nolib.s @@ -0,0 +1,25 @@ +# Write "hello world" and exit + +.include "linux.s" + +.section .data + helloworld: + .ascii "hello world\n" + helloworld_end: + + .equ helloworld_len, helloworld_end - helloworld + +.section .text + +.globl _start + +_start: + movq $STDOUT, %rdi + movq $helloworld, %rsi + movq $helloworld_len, %rdx + movq $SYS_WRITE, %rax + syscall + + movq $0, %rdi + movq $SYS_EXIT, %rax + syscall -- cgit v1.2.3