作者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)
1F:→ devilend:输出A*B的值 用C辅助计算JZorJNZ需要标LABEL表示跳到哪 01/19 12:49
2F:→ tedmax100:请问一下 要怎写? 01/19 13:00
3F:→ guts:有高手可以帮忙一下吗?!!这题我也刚好不会 .......= =" 01/19 22:06