Question
Consider the following pseudo assembly code for computing c = a + b. Assume that a, b, and c are assigned to consecutive memory words
Consider the following pseudo assembly code for computing c = a + b. Assume that a, b, and c are assigned to consecutive memory words (memory is generally addressed byte by byte and assume that a word is 4 bytes), and address for a is 0x0000e308. Also, we have a = 20, b = 136, and c = 0 at the starting time. Assume that the first instruction of the code is stored in 0x00001018. Also, each instruction has the opcode in the first byte (most significant byte) and the remaining 3 bytes specify the corresponding address. The opcode for load is 1, store is 2, and add is 3.
load a
add b
store c
(a) Show the memory addresses and contents for all the instructions and data involved. Use the format as follows to express your answer (but the following is not the answer). For all data, use hexadecimal representation.
addresses contents
0x00002104 0x00000001
0x00002108 0x00000002
b) Write the micro instructions for the code segment. Assume that the current PC (program counter) is 0x00001018. For each micro-instruction, also indicate the data that is transferred (if it is memory access). For all data, use the hexadecimal representation. The following are the first two micro-instructions and the data transferred. Complete the rest.
Micro-instructions data
PC -> MAR 0x00001018
M -> MBR 0x0100e308
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started