Computer Systems


Question 1 (Assembly code)

Consider the following formula: (r1 ×(M1 +r2))−(r2 ×M2). Here r1 and r2 are

two registers, and M1 and M2 represent the contents of two memory addresses.

(a) Write an assembly program for computing the result of the formula into

register r3. Try to make the programme as short as possible.


(b) Consider the instructions in the ISA in the appendix. Determine for each

instruction its type, i.e., whether it does one or a combination of the

following: (1) data transfer, (2) data processing, (3) control.