Assignment 4 (10 Marks) : Online Submission Is Accepted ONLY. You May Scan Your Submission and Upload in BB
Assignment 4 (10 Marks) : Online Submission Is Accepted ONLY. You May Scan Your Submission and Upload in BB
Q1. [3.5 marks] Fill out the table below with new value of Registers R0, R1, and R2 after the
execution of each assembly code. Write the value in 32-bit Hexadecimal.
0x20000FF8
0x80008001 0x20000FFC
0x0120DC1F 0x20001000
0x12345678 0x20001004
0x1F2DFD5C 0x20001008
0xABCDEF98 0x2000100C
0x20001010
Page 1 of 2
CME331: Microprocessor, 2018-19, Term 1
Q2. [2 marks] Fill out the table below for an 8-bit system.
A B R=A+B N-Z-V-C
Q3. [1.5 marks] What are the addressing modes used in the following instructions?
B loop PC relative
Q4. [3 marks] Write an assembly subroutine, called Mul12, that multiplies an input by 12 using
only shift and add instructions (do not use MUL instruction). The input is passed to the subroutine
by value in Register R0, and the output is returned in Register R0.
Hint: If a is a variable, then 12a = 8a + 4a
Page 2 of 2