📅  最后修改于: 2020-12-06 08:03:52             🧑  作者: Mango
op source, destination
其中,op用作操作码,源和目标用作数据字段。
MODE | FORM | ADDRESS | EXAMPLE | ADDED COST |
---|---|---|---|---|
absolute | M | M | Add R0, R1 | 1 |
register | R | R | Add temp, R1 | 0 |
indexed | c(R) | C+ contents(R) | ADD 100 (R2), R1 | 1 |
indirect register | *R | contents(R) | ADD * 100 | 0 |
indirect indexed | *c(R) | contents(c+ contents(R)) | (R2), R1 | 1 |
literal | #c | c | ADD #3, R1 | 1 |
1.将寄存器移至存储器R0→M
MOV R0, M
cost = 1+1+1 (since address of memory location M is in word following the instruction)
2.间接索引模式:
MOV * 4(R0), M
cost = 1+1+1 (since one word for memory location M, one word
for result of *4(R0) and one for instruction)
3.字面量模式:
MOV #1, R0
cost = 1+1+1 = 3 (one word for constant 1 and one for instruction)