About
.data a1: .word 1, 24, 34, 23, 19, 43, 37, 29, 30, 40, 32, 50, 11, 15, 22 a2: .word 0 len: .word 15 i: .word 0 .text .globl main main: la $t1, a1 la $t2, a2 lw $t3, len lw $t4, i
loop: lw $s2, ($t1) lw $s3, ($t2) rem $s1, $s2, 2 beq $s1, 0, even addi $s3, $s2, 1 j check even: addi $s3, $s2, 2
check:
sw $s3, ($t2)
li $v0, 1
move $a0, $s3
syscall
li $v0, 11
li $a0, 32
syscall
addi $t4, $t4, 1
addi $t1, $t1, 4
addi $t2, $t2, 4
bne $t3, $t4, loop
exit: li $v0, 10 syscall .end main