Skip to content

Commit

Permalink
Add assembly
Browse files Browse the repository at this point in the history
Signed-off-by: 0x4248 <60709927+0x4248@users.noreply.github.com>
  • Loading branch information
0x4248 committed Oct 8, 2024
1 parent 18f98b8 commit 5b87126
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions asm/x64-linux/return/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nasm -f elf64 -o main.o main.s
ld -o main main.o
24 changes: 24 additions & 0 deletions asm/x64-linux/return/main.s
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5b87126

Please sign in to comment.