From 5b8712682fc789a83452d6bf1e3a65465439f4ce Mon Sep 17 00:00:00 2001 From: 0x4248 <60709927+0x4248@users.noreply.github.com> Date: Tue, 8 Oct 2024 11:47:30 +0100 Subject: [PATCH] Add assembly Signed-off-by: 0x4248 <60709927+0x4248@users.noreply.github.com> --- asm/x64-linux/return/build.sh | 2 ++ asm/x64-linux/return/main.s | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 asm/x64-linux/return/build.sh create mode 100644 asm/x64-linux/return/main.s diff --git a/asm/x64-linux/return/build.sh b/asm/x64-linux/return/build.sh new file mode 100644 index 0000000..2a08756 --- /dev/null +++ b/asm/x64-linux/return/build.sh @@ -0,0 +1,2 @@ +nasm -f elf64 -o main.o main.s +ld -o main main.o \ No newline at end of file diff --git a/asm/x64-linux/return/main.s b/asm/x64-linux/return/main.s new file mode 100644 index 0000000..feb40cb --- /dev/null +++ b/asm/x64-linux/return/main.s @@ -0,0 +1,24 @@ +; SPDX-License-Identifier: GPL-3.0 +; return +; +; main.asm +; +; Really basic program that returns 0 +; +; COPYRIGHT NOTICE +; Copyright (C) 2024 0x4248 and contributors +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the license is not changed. +; +; This software is free and open source. Licensed under the GNU general +; public license version 3.0 as published by the Free Software Foundation. + + +global _start +section .text + +main: + mov rax, 60 ; exit syscall + mov rdi, 0 ; Set 0 on return + + syscall ; Call the kernel \ No newline at end of file