Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Following is a simple program to add two integers. Write this code into MARS and answer the following questions. .data num1: .word 54 num2: .word

image text in transcribed
Following is a simple program to add two integers. Write this code into MARS and answer the following questions.
.data
num1: .word 54
num2: .word 40
.text
lw $s0,num1
lw $s1,num2
add $s2,$s0,$s1
li $v0,1
move $a0,$s2
syscall
What is the address and size of num1 and num2?
What is the address of the instruction lw$s0,num1
What is the machine code for instruction add $s2,$s0,$s1
What is the purpose of instruction li $v0,1
Why do we need to use the instruction move $a0,$s2
QUESTION 1 Following is a simple program to add two integers. Write this code into MARS and answer the following questions data num 1: word 54 num2 word 40 text lw $so, num1 lw $s1, num2 add $s2,$s0,$s1 $v0,1 move Sa0,$s2 syscall a What is the address and size of num1 and num2? b. What is the address of the instruction Iw$80, num1 c. What is the machine code for instruction add $s2.$50,$s1 d. What is the purpose of instruction li $v0,1 e. Why do we need to use the instruction move Sa0,$s2

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

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions

Question

KEY QUESTION Refer to columns 1 and 6 in the table for question

Answered: 1 week ago