Starting from:

$24.99

CSE230 Assignment 2 Solution

CSE/EEE230 Assignment2


Important: This is an individual assignment. Please do not collaborate.
It must be submitted on-line (course website).
Go to "GradeScope" tab on Canvas -> CSE/EEE230 -> Assignment2, and upload your program file.
No late assignment will be accepted


Minimal Submitted Files

You are required to turn in the following source file:
assignment2.s
Objectives:

-write an assembly language program to:
-load addresses of variables or values of variables into registers.
-perform arithmetic and logical operations on variables -use syscall operations to display integers and strings on the console window
Assignment Description:

Write a MIPS assembly language program that adds the following two integers and displays the sum and the difference. In the .data section, define two variables num1 and num2 both words. Initialize num1 to 91543 10 and num2 to D8C 16 (use 0x D8C to initialize, Note that D8C is a hexadecimal number). Your main procedure/function 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 syscall for 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 SPIM 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 number and they should be printed in decimal.
What to turn in::
Go to "GradeScope" tab on Canvas -> CSE/EEE230 -> Assignment2, and upload your program file.

Grading Criteria:
____/ 5 Documentation (header with your name, your information, and program description and comments within your code)
____/ 1 Indentation and spacing (easy to read)
____/ 6 Required functions and functionalities implemented
____/ 8 Produces correct results?
Total points: 20


ASU disclaimer (http://www.asu.edu/asuweb/disclaimer/)
Copying any content of this page will be a violation of the copy right.

More products