Progress on lc

This commit is contained in:
2026-09-15 11:12:20 -04:00
parent 201b37d9d1
commit ce8aa5cd86
2 changed files with 61 additions and 21 deletions
+20
View File
@@ -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