Progress on lc
This commit is contained in:
@@ -62,6 +62,26 @@ cat_file:
|
||||
mv s2, a1 # update the current byte count
|
||||
.LNoEndings:
|
||||
|
||||
la t1, number
|
||||
lb t1, 0(t1)
|
||||
beqz t1, .LNoNumbers
|
||||
|
||||
mv a1, s2 # load mod buf size to a1
|
||||
|
||||
beqz s1, 1f
|
||||
la a0, mod_buf_0 # load mod_buf_0 as read buf
|
||||
la a2, mod_buf_1 # load mod_buf_1 as write buf
|
||||
j 2f
|
||||
1:
|
||||
la a0, mod_buf_1 # load mod_buf_1 as read buf
|
||||
la a2, mod_buf_0 # load mod_buf_0 as write buf
|
||||
2:
|
||||
|
||||
call add_line_numbers
|
||||
xori s1, s1, 1 # flip the mod buf to write to
|
||||
mv s2, a1 # update the current byte count
|
||||
.LNoNumbers:
|
||||
|
||||
beqz s1, 1f
|
||||
la a1, mod_buf_0
|
||||
j 2f
|
||||
|
||||
Reference in New Issue
Block a user