0
有人可以告訴我如何比較ASM x64中的兩個參數(RDI
和RSI
)嗎?比較兩個參數ASM x64
我對編譯一個問題,當我使用:
cmp byte[rdi+rax],byte[rsi+rax]
我得到一個錯誤:
"error: invalid combination of opcode and operands"
有人可以告訴我如何比較ASM x64中的兩個參數(RDI
和RSI
)嗎?比較兩個參數ASM x64
我對編譯一個問題,當我使用:
cmp byte[rdi+rax],byte[rsi+rax]
我得到一個錯誤:
"error: invalid combination of opcode and operands"
cmp
指令,像大多數的x86/x86-64的指令,允許最多隻有一個內存操作數。因此,要比較兩個內存位置的內容,需要將其中至少一個加載到一個寄存器中:
mov cl, byte[rdi+rax]
cmp cl, byte[rsi+rax]
您不能有兩個內存操作數。先將一個加載到一個寄存器中。 – harold 2012-03-25 17:08:19
好的,謝謝。像那樣 :? MOV RCX,RDI CMP字節[RDI + RAX],字節[RCX + RAX] 我有一個錯誤太.. :( – Zat42 2012-03-25 17:13:10
喜歡的是:'MOV CL,字節[RDI + RAX]; CMP CL ,字節[rsi + rax]' – 2012-03-25 17:32:21