New modbuf for multiple flags #4

Merged
Lexzach merged 3 commits from mod-buf into master 2026-09-15 00:57:38 +00:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit 3eb098e84b - Show all commits
+1
View File
@@ -40,6 +40,7 @@ cat_file:
ecall
blez a0, .LCloseFD # if we haven't read any bytes, EOF, close FD
mv s2, a0
li s1, 1
la t1, show_ends
lb t1, 0(t1)
+2 -2
View File
@@ -19,7 +19,7 @@ help:
.equ HELP_LEN, . - help
version:
.ascii "cat 1.1.0\n"
.ascii "cat 1.2.0\n"
.ascii "Copyright (C) 2026 lexzach\n"
.ascii "License MIT\n"
.ascii "This is free software: you are free to change and redistribute it.\n"
@@ -61,9 +61,9 @@ _start:
addi sp, sp, -8
sd a0, 0(sp)
call _is_known_flag
bnez a1, .LSkipArg # check if arg is flag
ld a0, 0(sp)
addi sp, sp, 8
bnez a1, .LSkipArg # check if arg is flag
call cat_file
addi s2, s2, 1
bnez a0, .LReturnFileErr # error if failed