I have the following problem when designing this problem is ASM: I have an array and a number x. I have to compute the sum of the elements which are greater than x and they have at least two odd digits. I managed to check for the first condition but don't know how to check for the second...
.data
array: .word 11776, 117760, 341504, 1177600, 11776000, 117760000
length: .word 6
sum: .word 0
x: .word 16
.text
main:
la $t0, array # Base address
li $t1, 0 # i = 0
lw $t2, length # $t2 = length
li $t3, 0 # sum = 0
li $t5, x # x = 0
syscall
sumLoop:
lw $t4, ($t0) # $t4 = array[i]
$IF($t4 > $t5)
add $t3, $t3, $t4 # sum = sum + array[i]
add $t1, $t1, 1 # i = i + 1
add $t0, $t0, 4 # Updating the array address
blt $t1, $t2, sumLoop # If i < lenght the loop again
sw $t3, sum