Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Nama :

Anandwi Ghurran Muhajjalin Arreto (1706985911)


Gita Ayu Salsabila (1706043310)

Exercise Problem 1
Given the following values and a one-address machine with an
accumulator,what values do the following instructions load into
the accumulator?
-Word 20 contains 40 -Word 40 contains 60
-Word 30 contains 50 -Word 50 contains 70
(a) Load Immediate 20 (Load #20)
(b) Load Direct 20 (Load 20)
(c) Load Indirect 20 (Load @20)
(d) Load Direct 30 (Load 30)
(e) Load Indirect 30 (Load @30)
Answer :
(a) Load #20  ACC = 20
(b) Load 20  ACC = 40
(c) Load @20  ACC = 60
(d) Load 30  ACC = 50
(e) Load @30  ACC = 70
Exercise Problem 2
Given the following values and a one-address machine with an
accumulator,what are the results of the following instructions?
-Word 20 contains 40 -Word 40 contains 60
-Word 30 contains 50 -Word 50 contains 70
-R1 contains 40 -R2 contains 60
(a) Load #20, then Store (R1)
(b) Load 20, then Add R2
(c) Load 30, then Sub R1
(d) Load @30, then Mul #2
(e) Load 50, then Sub @30

Answer :

(a) Load #20  ACC = 20, STORE (R1)  Word 40 = 20


(b) Load 20  ACC = 40, ADD R2  ACC = 100
(c) Load 30  ACC = 50, SUB R1  ACC = 10
(d) Load @30  ACC = 70, MUL #2  ACC = 140
(e) Load 50  ACC = 70, SUB @30 ACC = 0

You might also like