Complete line numbers

This commit is contained in:
2026-09-15 11:28:07 -04:00
parent ce8aa5cd86
commit f4ccd72b4a
2 changed files with 43 additions and 21 deletions
+20 -20
View File
@@ -42,26 +42,6 @@ cat_file:
mv s2, a0
li s1, 1
la t1, show_ends
lb t1, 0(t1)
beqz t1, .LNoEndings
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_endings
xori s1, s1, 1 # flip the mod buf to write to
mv s2, a1 # update the current byte count
.LNoEndings:
la t1, number
lb t1, 0(t1)
beqz t1, .LNoNumbers
@@ -82,6 +62,26 @@ cat_file:
mv s2, a1 # update the current byte count
.LNoNumbers:
la t1, show_ends
lb t1, 0(t1)
beqz t1, .LNoEndings
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_endings
xori s1, s1, 1 # flip the mod buf to write to
mv s2, a1 # update the current byte count
.LNoEndings:
beqz s1, 1f
la a1, mod_buf_0
j 2f