Add _is_known_flag func
This commit is contained in:
+4
-4
@@ -2,7 +2,7 @@
|
||||
sp_start: .space 8
|
||||
|
||||
.section .text
|
||||
.globl save_sp, fetch_argc, fetch_argv, has_switch
|
||||
.globl save_sp, fetch_argc, fetch_argv, has_switch, str_cmp
|
||||
|
||||
save_sp:
|
||||
sd sp, sp_start, t0 # save the stack pointer
|
||||
@@ -125,13 +125,13 @@ has_switch:
|
||||
|
||||
mv a0, s3 # load argv buff addr into a0 (string 0)
|
||||
mv a1, s0 # move switch ptr 1 addr into a1 (string 1)
|
||||
call _str_cmp
|
||||
call str_cmp
|
||||
bnez a1, .LSwitchFound # if the strings match, exit loop
|
||||
beqz s1, .LSkipSecondSwitch # if we have no second switch, skip the check
|
||||
|
||||
mv a0, s3 # move argv buff addr into a0 (string 0)
|
||||
mv a1, s1 # move switch ptr 2 addr into a1 (string 1)
|
||||
call _str_cmp
|
||||
call str_cmp
|
||||
bnez a1, .LSwitchFound # if the strings match, exit loop
|
||||
|
||||
.LSkipSecondSwitch:
|
||||
@@ -170,7 +170,7 @@ has_switch:
|
||||
# @param[in] a1: str buffer 2
|
||||
# @param[out] a0: result code.
|
||||
# @param[out] a1: is equal (0-no, 1-yes).
|
||||
_str_cmp:
|
||||
str_cmp:
|
||||
li t2, 0
|
||||
|
||||
.LByteCmp:
|
||||
|
||||
Reference in New Issue
Block a user