0

反转寄存器内容的指令是什么?

我正在使用这两条指令对两个寄存器进行 AND 逻辑运算,并将其结果存储在第三个单独的寄存器中:

and ax, dx ; AND operation b/w ax and dx register and storing its result in ax first then 
mov bx, ax ; storing result in bx.

它不能在一条指令中同时发生(我的意思是操作并将结果存储在单独的寄存器中)吗?

我正在使用 NASM 汇编器和 AFD 调试器。

4

1 回答 1

2

No, it can't as a single operation can not act upon 3 registers.

You're suggesting that you can do:

bx = ax & dx

as a single instruction, and that's simply not the case. What you have instead is:

ax = ax & dx
bx = ax

You could always swap it around:

mov bx, ax
and bx, dx

but it's still the same number of instructions.

于 2013-04-25T03:23:44.443 回答