.data sentence: .ascii "Become a Prograammermmmmmrr\0" match: .ascii "Babc m\0" out: .space 256, 0 .text .align 2 .globl _start _start: la t0, sentence # Load the address of sentence into t0 read_str: lbu t1, 0(t0) # Load unsigned byte from sentence into t1 beq t1, zero, read_str_done # If end of string (\0), exit loop la a0, match # Load address of match into a0 la s2, out # Load address of out into s0 iteruj_match: lbu a1, 0(a0) beq a1, zero, done_match bne t1, a1, 1f lbu s10, 0(s2) addi s10, s10, 1 sb s10, 0(s2) 1: addi a0, a0, 1 addi s2, s2, 1 j iteruj_match done_match: addi t0, t0, 1 # Increment pointer to the next character in sentence j read_str # Jump back to start of outer loop read_str_done: ebreak # End program