I have array of words in .data
array: .word 0x0000012, 0x0000d42f, ..... , 0 // 0 indicates end of array.
I need to print each word's count of '1's and then at the end print the maximum count of '1's .
I tried moving the word to a temporary register and then shift it left, each iteration, but it doesn't work ..
################### Data segment ###################
.data
x: .word 0x00000001, 0x00000007, 0x0000ffff, 0x20430066, 0
bits: .word 0
################### Code segment ###################
.text
.globl main
main:
lw $a0, x
li $v0,1
syscall
li $v0,10 # exit
syscall
That code works. but it only refers to the first word in x. I don't know how to get to the second WORD in x
User contributions licensed under CC BY-SA 3.0