Finish number-nonblank

This commit is contained in:
2026-09-15 16:08:52 -04:00
parent 90b6c515ca
commit ca7daa1734
2 changed files with 22 additions and 3 deletions
+20
View File
@@ -42,6 +42,26 @@ cat_file:
mv s2, a0
li s1, 1
la t1, number_nonblank
lb t1, 0(t1)
beqz t1, .LNoNonblankNumbers
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
.LNoNonblankNumbers:
la t1, number
lb t1, 0(t1)
beqz t1, .LNoNumbers