Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Assignment 2

Semester: Fall 2021

Deadline: 21 April 2021

Instructor: Hira Hameed

Q uestion 1:
Find the MIPS instruction represented by the following machine code:

1010 1101 0001 0000 0000 0000 0000 0010

Q uestion
2:
Translate the following statements into MIPS assembly language. Assume that a, b, c,
and d are allocated in $s0, $s1, $s2, and $s3.

a) if ((a > b) || (b > c)) {d = 1;}


b) if ((a <= b) && (b > c)) {d = 1;}

Q uestion 3:
Translate the following MIPS assembly language program to MIPS machine language
and discuss its addressing mode diagrammatically.

a. lw $t2, 32($0)
b. addu $s0, $s1, $s2
c. subi $t0, $s3, -12
d. sub $t0, $t3, $t5
e. j 10001

You might also like