Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using MIPS Assembly Language Lab#4 starter code .data array_siz: .asciiz Enter Array Size: enter_num: .asciiz Enter Num: .text main: # Display Enter Array

Using MIPS Assembly Languageimage text in transcribed

Lab#4 starter code

.data array_siz: .asciiz "Enter Array Size: " enter_num: .asciiz "Enter Num: " .text

main: # Display "Enter Array Size: " li $v0, 4 la $a0, array_siz syscall #Get Array Size and Store in $s0 li $v0, 5 syscall move $s0, $v0 # Array Size move $t0, $gp #$t0 is base address li $t1, 0 # i = 0 start: bge $t1, $s0, end #Dispaly "Enter Num: " li $v0, 4 la $a0, enter_num syscall #Get Num and Store in Memory li $v0, 5 syscall sw $v0, 0($t0) addi $t0, $t0, 4 # Advance Address to Next Word addi $t1, $t1, 1 # i++ j start end: move $a0, $gp # 1st Parameter is the base address li $a1, 5 # 2nd Parameter is array size jal avg #jal stddev # Uncomment for Challenge problem # Print Result move $a0, $v0 li $v0, 1 syscall j exit

avg: # YOUR CODE HERE # $a0 is the array base address # $a1 is the array size #The average should be placed in $v0 (for now just set to zero) li $v0, 0 jr $ra

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What attracts you about this role?

Answered: 1 week ago

Question

How many states in India?

Answered: 1 week ago

Question

HOW IS MARKETING CHANGING WITH ARTIFITIAL INTELIGENCE

Answered: 1 week ago

Question

1. Discuss the four components of language.

Answered: 1 week ago

Question

f. What stereotypes were reinforced in the commercials?

Answered: 1 week ago