Answer:
The Assembly code is given below with appropriate comments
Step-by-step explanation:
#Data Section
.data
#Display the Labels
number1: .asciiz "num1 is : "
number2: .asciiz "\\num2 is : "
addition: .asciiz "\\num1 + num2 = "
subtraction: .asciiz "\\num1 - num2 = "
#variable declarations
num1: .word 50274
num2: .word 0xCB7
.text
#Main method
main :
# print the label number 1
li $v0,4
la $a0,number1
syscall
# print the value
li $v0,1
la $a0,num1
lw $a0,($a0)
syscall
# print the label number2
li $v0,4
la $a0,number2
syscall
# print the value
li $v0,1
la $a0,num2
lw $a0,($a0)
syscall
#Compute addition of two numbers
la $t0,num2
lw $t0,($t0)
la $t1,num1
lw $t1,($t1)
add $t0,$t1,$t0
# print the label
li $v0,4
la $a0,addition
syscall
# print the value
li $v0,1
addi $a0,$t0,0
syscall
#Compute subtraction of two numbers
la $t0,num2
lw $t0,($t0)
la $t1,num1
lw $t1,($t1)
sub $t0,$t1,$t0
# print the label3
li $v0,4
la $a0,subtraction
syscall
# print the value
li $v0,1
addi $a0,$t0,0
syscall