Question: spim: (parser) syntax error bne $t1, '0', endStr #if the byte is equal to 0, loop is complete, proceed to endStr ^ The following symbols
spim: (parser) syntax error
bne $t1, '\0', endStr #if the byte is equal to "\0", loop is complete, proceed to endStr
^ The following symbols are undefined: ans
Instruction references undefined symbol at 0x00400000 [0x00400000] 0x3c010000 lui $1, 0 [ans] ; 39: la $t0, ans #assigns array "ans" to $t0
MARKFILE ERROR 4. File contains parser error: ./markcase.a case 0 FAILS
What is causing this error in MIPSMARK? Code shown below.
#-------------- start cut -----------------------
la $t0, ans #assigns array "ans" to $t0
loop: lb $t1, 0($t0) #loads a byte into the loop bne $t1, '\0', endStr #if the byte is equal to "\0", loop is complete, proceed to endStr bgt $t1, 'a', lower #if the byte is lower case, proceeds to lower bgt $t1, 'A', upper #if the byte is upper case, proceeds to upper b next #when the loop is complete, moves to "next"
lower: sub $t1, $t1, 'a' #subs 'a' from $t1 add $t1, $t1, 'A' #adds 'A' to $t1 sb $t1, 0($t0) #stores byte with a lower case value b next #moves on to "next" upper: sub $t1, $t1, 'A' #subs 'A' from $t1 add $t1, $t1, 'a' #adds 'a' to $t1 sb $t1, 0($t0) #stores the byte with an upper case value next: add $t0, $t0, 1 #the pointer is incrimented by one char b loop #returns to loop, repeats until loop is completed
endStr: la $a0, ans #system call li $v0, 4 #call to print syscall #result is printed
lw $t0, number #loads word "number" to $t0 sra $t0, $t0, 5 #shifts 5 times, then divides by 2 move $a0, $t0 #moves $a0 to $t0 li $v0, 1 #call to exit program syscall #exit program
#/*-------------- end cut ----------------------- # Any changes below this line will be discarded by # mipsmark. Put your answer between dashed lines.
################################################# # # # data segment # # # #################################################
.data #*/ number: .word -32760 ans: .asciiz "NUM dIVIDED bY 32 = " endl: .asciiz " "
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
