-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
BITS 64 | ||
%define BUFFER 256 | ||
|
||
global _start | ||
|
||
section .rodata | ||
|
||
linefeed db 0xA | ||
linefeed_len equ $-linefeed | ||
|
||
section .bss | ||
|
||
uname resb BUFFER | ||
|
||
section .text | ||
|
||
_start: | ||
mov rax, 63 | ||
mov rdi, uname | ||
syscall | ||
jmp _print_uname | ||
|
||
_print_uname: | ||
mov rax, 0x1 | ||
mov rdi, 0x1 | ||
mov rsi, uname | ||
mov rdx, BUFFER | ||
syscall | ||
jmp _linefeed | ||
|
||
_linefeed: | ||
mov rax, 0x1 | ||
mov rdi, 0x1 | ||
mov rsi, linefeed | ||
mov rdx, linefeed_len | ||
syscall | ||
jmp _exit | ||
|
||
_exit: | ||
mov rax, 0x3C | ||
mov rdi, 0 | ||
syscall |
Binary file not shown.