This is to be done in MIPS assembly language.
Define an int array of size 12. Initialize this array with number from 12 to 1. Display this array.
.data array: .space 48 # create array of size 12 newline: .asciiz "\n" .text # initialize the array la $s0, array li $t0, 0 li $t2, 12 while: bge $t0, 12, end sll $t1, $t0, 2 add $t1, $t1, $s0 addi $t0, $t0, 1 sw $t2, 0($t1) addi $t2, $t2, -1 j while end: # print the array li $t0, 0 while1: bge $t0, 12, end1 sll $t1, $t0, 2 add $t1, $t1, $s0 addi $t0, $t0, 1 lw $t1, 0($t1) addi $a0, $t1, 0 li $v0, 1 syscall la $a0, newline li $v0, 4 syscall j while1 end1:
Get Answers For Free
Most questions answered within 1 hours.