Docsity

MIPS Program Analysis, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
Answer the following questions with respect to the MIPS program shown below. Assume that
the data segment starts at 0x10010000 and the text segment starts at 0x00400000.
A. What function does the last two instructions in the main program realize?
B. With respect to the above program,
• what are the values of the following symbols?
• What is the total number of bytes required for this program, both data segment and
text segment storage?
.data
.word 0x21, 32
.byte 4, 3
.ascii”Test”
.text
li $4, 4
jal func
slt $7, $0, $4
bne $7, $0,loop
li $v0, 10
syscall
addi $4, $4, -1
jr $31
first:
str:
main:
loop:
func:
.align 2
end:
Program Exit.
end __0x00400014_____________
loop __0x04000004_____________
func __0x04000018_____________
str __0x1001000c_____________
data segment - 16
text segment - 32

Partial preview of the text

Download MIPS Program Analysis and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

Answer the following questions with respect to the MIPS program shown below. Assume that

the data segment starts at 0x10010000 and the text segment starts at 0x00400000.

A. What function does the last two instructions in the main program realize?

B. With respect to the above program,

- what are the values of the following symbols? - What is the total number of bytes required for this program, both data segment and text segment storage?

.data .word 0x21, 32 .byte 4, 3

.ascii”Test”

.text li $4, 4 jal func slt $7, $0, $ bne $7, $0,loop

li $v0, 10 syscall

addi $4, $4, - jr $

first:

str:

main: loop:

func:

.align 2

end:

Program Exit.

end __0x00400014_____________

loop __0x04000004_____________

func __0x04000018_____________

str __0x1001000c_____________

data segment - 16 text segment - 32