[問題] 98政大資科第二題
2. Assuming that the variables a, b, c and d are stored in memory
locations 100, 101, 102, and 103, resprctively.
Using any of sample machine language instructions given below,
translate the following pseudocode operations into
machine language instructions sequences.
(a) Set a to the value b+c+d
(b) Set a to the value (b*d)-(c*d)
Operation Meaning
--
LOAD X
Load register R with the contents of memory location X.
STORE X
Store the contents of register R into memory location X.
MOVE X, Y
Copy the contents of memory location X into memory location Y.
ADD X
Add the contents of memory location X to the contents of register R,
Put the result back into register R. i.e., R=R+CON(X).
SUB X
Subtract the contents of memory location X from the contents of
register R, Put the result back into register R. i.e., R=R-CON(X).
--
MUL X
Multiplythe contents of memory location X from the contents of register
R, Put the result back into register R. i.e., R=R*CON(X).
上面是題目版面有點長 ( ̄ー ̄;),
machine langaue有需要將結果回存嗎 ?
小弟認為答案是,可是對STORE這指令有些疑慮...有需要用到STORE嗎?
請大大指教
(a)
LOAD 101
ADD 102
ADD 103
(b)
LOAD 101
SUB 102
MUL 103
--
◢█M◣ ◢˙‥◣ ,謝謝你救了我
▄ ▄ ●‥˙
◤○︹○ 將心比心 ˙˙◥● 可是公主在另一個城堡裡…
◥ □◤ 好嗎? ◥▼ ◤
◢ ◤ ◥ ▃ ◣
◤◥ ◤◥
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 219.85.184.10
推
05/18 23:35, , 1F
05/18 23:35, 1F
→
05/18 23:36, , 2F
05/18 23:36, 2F
→
05/18 23:36, , 3F
05/18 23:36, 3F
→
05/18 23:41, , 4F
05/18 23:41, 4F