New modbuf for multiple flags #4
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user