Tamamlanmış

MIPS program that counts letters from a string

I am working on a MIPS code and I cannot get it to run correctly. Please see attached image for correct output. I need my code to be fixed and I need the last print part to be added (the part that prints #)

.data

sentence: .asciiz "coming in winners of three in a row, including back-to-back triumphs on the road, the knights returned to orlando hungry to finish out the regular season home schedule on a high note."

word: .asciiz "KNIGHTS"

space: .asciiz ": ----------- "

newLine: .asciiz "\n"

.text

la $a1, sentence

la $a2, word

Loop:

lb $t2, 0($a2) # loads msb of a2 to t2

beqz $t2, exit1 # check for the null character

lb $t1, 0($a1) # loads msb of a1 to t1

li $t0, 0 # sets counter to 0

move $a0, $t2 # moves value of t2 to a0

li $v0, 11

syscall

la $a0, space

li $v0, 4

syscall

Loop2:

beqz $t1, continue

beq $t1, $t2, increment

addi $a1, $a1, 1 # Moves to next letter in word

lb $t1, 0($a1)

#li $v0, 4 # test

#la $a0, word # test

#syscall #test

j Loop2

increment:

addi $t0, $t0, 1 # adds to the counter

addi $a1, $a1, 1 # adds to the other counter

#lb $t1, 0($a1)

j Loop2

continue:

move $a0, $t0

li $v0, 1

syscall

la $a0, newLine

li $v0, 4

syscall

addi $a2, $a2, 1

j Loop

exit1:

Beceriler: Montaj, x86/x64 Çevirici, Yazılım Mimarisi

Daha fazlasını gör: masking division mips program, exponential function mips program, software program counts number times song played, count words in a string mips, mips read character from string, mips compare strings, count words in mips, mips program to count how many times a character occurs in a string, mips count string length, determine the number of occurrences of a specific character in a string mips, mips replace character in string, program counts replace spaces, mips program count number ones given integer, mars mips program, double precision mips program, mips program example double, mips program compute value, program counts clicking keyboard, mips program prompts user enter line input, write mips program multiply

İşveren Hakkında:
( 0 değerlendirme ) Orlando, United States

Proje NO: #22370465

Seçilen:

Kingstech35

Hi, dear. Thank you for your job posting. I have majored in mathematics, program - C++/C#, Arm Assembly, Mips, Qtspim & Matlab program. I am also good at Java, Office, R programming and Python. And I have plenty of exp Daha Fazla

$20 USD / saat
(3 Değerlendirme)
3.1

Bu iş için 2 freelancer ortalamada $20/saat teklif veriyor

nourreddinebenme

hello sir i have good experience in mips this project easy for me when i complete it you can check and then you can accept my bid feel free to message me :)

$20 USD / saat
(53 Değerlendirme)
5.2