mirror of
https://github.com/guezoloic/minishell.git
synced 2026-01-25 04:34:22 +00:00
feat: add basic minishell input output
This commit is contained in:
32
src/main.s
32
src/main.s
@@ -1,6 +1,30 @@
|
||||
.global _start
|
||||
.global _start
|
||||
|
||||
.section .data
|
||||
msg:
|
||||
.ascii "[minishell]$ "
|
||||
len = . - msg
|
||||
|
||||
.section .bss
|
||||
buffer:
|
||||
.skip 128
|
||||
|
||||
.section .text
|
||||
_start:
|
||||
mov $60, %rax
|
||||
xor %rdi, %rdi
|
||||
syscall
|
||||
mov $1, %rax
|
||||
mov $1, %rdi
|
||||
lea msg(%rip), %rsi
|
||||
mov $len, %rdx
|
||||
syscall
|
||||
|
||||
mov $0, %rax
|
||||
mov $0, %rdi
|
||||
lea buffer(%rip), %rsi
|
||||
mov $128, %rdx
|
||||
syscall
|
||||
|
||||
jmp _start
|
||||
|
||||
mov $60, %rax
|
||||
xor %rdi, %rdi
|
||||
syscall
|
||||
|
||||
Reference in New Issue
Block a user