Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a MIPS assembly language program that adds two integers and displays the sum and the difference. In the .data section, define two variables num1

Write a MIPS assembly language program that adds two integers and displays the sum and the difference. In the .data section, define two variables num1 and num2 both words. Initialize num1 to 75301 10 and num2 to D5A 16 (use 0xD5A to initialize, Note that D5A is a hexadecimal number). Your main procedure should load the values of num1 and num2 into two temporary registers, and display them on the console window. Then add the values together, and use the print_int system call function to display the sum on the console window. Also compute the difference of two numbers and display it on the console window. (Reference: see Assignment 1) To print an integer on the console window, you must put the integer to be printed in the $a0 register, and the value 1 in the $v0 register. Then perform a syscall operation. This makes a call to the PCSPIM operating system which will display the integer in $a0 on the console window. Name your source code file assignment2.s.

Your output format should look as follows:

num1 is: XXX

num2 is: XXX

num1+num2 = XXX

num1-num2 = XXX

where XXX is the correct number for each.

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

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions

Question

Intercultural Communication Challenges?

Answered: 1 week ago

Question

5. A review of the key behaviors is included.

Answered: 1 week ago

Question

3. An overview of the key behaviors is presented.

Answered: 1 week ago