Question: 3. [20 marks] Architecture versus Implementation. The 'M' machine is a memory-memory architecture. For example, its floating-point multiply instruction is: 'mmul.d a,b,c', meaning take the
3. [20 marks] Architecture versus Implementation. The 'M' machine is a memory-memory architecture. For example, its floating-point multiply instruction is: 'mmul.d a,b,c', meaning "take the 64-bit floating-point values starting at memory addresses 'b' and 'c', respectively, multiply them, and store the 64-bit floating-point result starting at memory address 'a'". The 'M' machine is implemented by a smaller, embedded 'J' machine. A program translates each 'M' machine instruction into one or more 'J' machine instructions, listed below.
lw r1,a // load 32 bits starting at 'a'
sw r1,a // store 32 bits starting at 'a'
pack f0,r1,r2 // pack two 'r' registers into one 'f' register
unpack f0,r1,r2 // unpack one 'f' register into two 'r' registers
mul.d f0,f2,f4 // perform floating-point multiply f2 * f4
Write a J-machine program that implements 'mmul.d a,b,c'.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
