Midterm Exam1 - 2020-2021 - Model Answer
Midterm Exam1 - 2020-2021 - Model Answer
3) Assume R1 = 10011010 (8btis), R2 will contain ……… after executing AshiftR R2,R1, #3
a) 10011010 b) 11110011 c) 11100111 d) 00010011
4) Assume R1 = 10011010 (8btis), R2 will contain ……… after executing AshiftL R2,R1, #3
a) 10011010 b) 11010000 c) 11010111 d) 11110011
5) Assume R5 = 01110011 (8btis), R3 will contain ……… after executing RotateL R3,R5, #4
a) 00110000 b) 00110111 c) 00111110 d) 11010000
6) Assume R5 = 01110011 (8btis), R3 will contain ……… after executing RotateRC R3,R5, #4
a) 11001110 b) 00110011 c) 00110011 d) 00111001
1
7) Assuming 5-bit 2’s-complement numbers, the output of the following addition 7 and 13 is :
a) 00100 b) 10100 c) 00101 d) 11100
8) Assuming 5-bit 2’s-complement numbers, the output of the following addition -2 and -9 is :
a) 11101 b) 10101 c) 10111 d) 11110
9) In subroutine linkage …………. is used to save the address for return instruction to use:
a) Link register b) Stack pointer c) Frame pointer d) PC register
10) If SP points to top of stack which of the following statements pushes a new value from Register
R2 to top of stack:
12) If R4 contain the decimal number 2000, what is the effective address in case of 12(R4):
a) 2000 b) 2012 c) 1988 d) none of the mentioned
13) Which of the following instructions causes the value 300 to be stored in memory location 1000:
a) store 1000,300 b) load R2,#1000 c) load R2,#1000 d) load R2,#300
load R3,#300 load R3,#300 load R3,#100
store R3,(R2) store R3, R2 store R3,(R2)
14) …………. is the assembly directive that define the starting memory address to store program instruction.
a) RESERVE b) ORIGIN c) DATAWORD d) EQU mentioned
15) Which of the following instructions uses hexadecimal representation for number:
a) ADD R2,R3, #0h5D b) ADD R2,R3, %01011101 c) ADD R2,R3, #0x5D
Q3. [5 marks]
Write a RISC-style program that computes the expression Z = (A * B + C) / D.
LOAD R2, A
LOAD R3, B
LOAD R3, C
ADD R2,R2,R3
LOAD R3, D
Divide R2,R2,R3
STORE R2, Z
Best Wishes