[問題] 98政大資科第二題

看板TransCSI作者 (鰲倫)時間15年前 (2010/05/18 16:47), 編輯推噓1(103)
留言4則, 2人參與, 最新討論串1/1
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 -- ◢█˙‥ ,謝謝你救了我 ▄ ▄ ●‥˙ ○︹○ 將心比心 ˙˙ 可是公主在另一個城堡裡… 好嗎? ◤◥ ◤◥ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.85.184.10

05/18 23:35, , 1F
我是覺的不用,因為題目沒寫到類似A=B+C+D,只寫了算式
05/18 23:35, 1F

05/18 23:36, , 2F
如果有寫到,就要store a
05/18 23:36, 2F

05/18 23:36, , 3F
修正,是STORE 100
05/18 23:36, 3F

05/18 23:41, , 4F
謝謝s大。記得之前寫組語很像也沒有回存的樣子。
05/18 23:41, 4F
文章代碼(AID): #1BybGxZK (TransCSI)