开发者

Register indirect addressing

I would like to know if the开发者_开发技巧re is a difference between:

MOV [BX] + 20, AX

and

MOV [BX + 20], AX

My reasoning is that for the 1st case, we move the value of AX + 20 into the address BX

And for the 2nd case, we move the value of AX into the address BX+ 20

Thanks.


Some assembler compilers allow both combinations. However, the debugger should give you right answer!

Test.asm.5: MOV [BX] + 20, AX
004552B4 894314           mov [bx+$14],ax
Test.asm.6: MOV [BX + 20], AX
004552B7 894314           mov [bx+$14],ax


Your reasoning on the first case is wrong. That's not a valid construct (unless you have a macro defined to turn it into 2 instructions). You can't stick a value ADD in the middle of a MOV. You can only use the immediate offset to the address (second case).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜