作者tedmax100 (tedmax)
看板Grad-ProbAsk
標題[理工] [計組]-98年高大-資工系
時間Tue Jan 19 12:14:29 2010
Write a program using instructions in the instruction set shown below to
output the result of A * B, where A and B are two registers storing integer
values (assume no overflow). Your program may use an auxiliary register C in
the computation. You may also label an instruction as a target of instruction
JZ or JNZ. (15%)
Instruction Meaning (X and Y are any two registers; L denotes a label)
ADD X, Y Store the result of X + Y to X
SUB X, Y Store the result of X – Y to X
INC X Increase the value of X by one
DEC X Decrease the value of X by one
JZ X, L Jump to Label L if X = 0
JNZ X, L Jump to Label L if X ≠ 0
OUT X Output the value of X
請問這是要設計出A*B 用這指令集所擁有的指令? 並把結果寫入C?
那最後一句話 是要做什麼? 煩請高手解答一下
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.117.206.69
※ 編輯: tedmax100 來自: 122.117.206.69 (01/19 12:14)
※ 編輯: tedmax100 來自: 122.117.206.69 (01/19 12:25)
→ devilend:輸出A*B的值 用C輔助計算JZorJNZ需要標LABEL表示跳到哪 01/19 12:49
→ tedmax100:請問一下 要怎寫? 01/19 13:00
→ guts:有高手可以幫忙一下嗎?!!這題我也剛好不會 .......= =" 01/19 22:06