Consider the following MIPS assembly language program: # Data area .data mydata: .word 0x4CAFE, 0xBABE # output: .word 0 # for storing the result # # Instructions (program) area .text main: la $s0,...


Consider the following MIPS assembly language program:



# Data area


.data


mydata: .word 0x4CAFE, 0xBABE


#


output: .word 0 # for storing the result


#


# Instructions (program) area


.text


main: la $s0, mydata # load the address of memory location mydata to $s0


lw $t0, ($s0) #


lw $t1, 4($s0) #


sub $t2, $t0, $t1 #


#


la $s1, output # Load the address of memory location output to $s1


sw $t2, ($s1) #


#


li $v0, 1 # syscall #1 (print int)


srl $a0, $t2, 1 # divide by 2


syscall # invoke syscall to print



#



# The END



1)      What will be seen on MARS console when this program runs? [x]



Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here