(a) Give a short sequence of machine instructions for the task: Add the contents of memory location...

Question:

(a) Give a short sequence of machine instructions for the task: "Add the contents of memory location A to those of location B, and place the answer in location C." Instructions and Load LOC,R Store R,LOC are the only instructions available to transfer data between the memory and general- purpose register R. Add instructions were described in Sections 1.3 and 1.6.3. Do not destroy the contents of either location A or B.

(b) Suppose that Move and Add instructions are available with the format Move/Add Location1,Location2 These instructions move or add a copy of the operand at the first location to the second location, overwriting the original operand at the second location. Locationi can be in either the memory or the processor register set. Is it possible to use fewer instructions to accomplish the task in Part a? If yes, give the sequence.

LO1

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Computer Organization

ISBN: 9780072320862

5th Edition

Authors: V Carl Hamacher, Carl Hamacher, Zvonko G Vranesic, Safwat G Zaky

Question Posted: