Compare commits

..

No commits in common. "be3ea1c23086c04c8f3ae6fc2150ed86f1ca48e9" and "4fe958dbd68ee086c9e5713227348bbb4cce783f" have entirely different histories.

View File

@ -2,13 +2,13 @@
sentence: sentence:
.ascii "Become a Prograammermmmmmrr\0" .ascii "Become a Prograammermmmmmrr\0"
match: match:
.ascii "Babc m\0" .ascii "abc \0"
out: out:
.space 256, 0 .space 256, 0
.text .text
.align 2 .align 2
.globl _start .globl _start addi t0, t0, 1 # Increment pointer to the next character in sentence
_start: _start:
@ -22,19 +22,17 @@ read_str:
la s2, out # Load address of out into s0 la s2, out # Load address of out into s0
iteruj_match: iteruj_match:
lbu a1, 0(a0) lbu a1, 0(a0)
beq a1, zero, done_match beq a1, zero, done_match
bne t1, a1, 1f bne t1, a1, 1f
lbu s10, 0(s2) lbu s11, 0(s2)
addi s10, s10, 1 addi s10, s10, 1
sb s10, 0(s2) sb s10, 0(s2)
1: 1:
addi a0, a0, 1 addi s0, s0, 1
addi s2, s2, 1
j iteruj_match j iteruj_match
done_match: done_match: