
December 4th, 2012, 01:49 PM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 2
Time spent in forums: 8 m 5 sec
Reputation Power: 0
|
|
|
Assembly - Words
Hi, guys I'm trying to calculate number of words inside the string however I'm not sure how to structure and loop and how to write it to detect the empty spaces.
I'm using Mars Assembly here is the structure I would like to use:
Code:
.data
text_input: .asciiz "Two words"
word_count: .word 0
.text
.globl main
main:
la $a0, text_input # Load address of string.
addi $t1, $a0, 0
nop
Loop:
lbu $t0, 0($t1) #go through string one by one
I'm at this stage however not sure what to do next...
|