Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ASM x64 で2 つの引数 ( RDIand ) を比較する方法を教えてください。RSI
RDI
RSI
以下を使用すると、コンパイルに問題があります。
cmp byte[rdi+rax],byte[rsi+rax]
エラーが発生します:
"error: invalid combination of opcode and operands"
cmp命令は、x86/x86-64 命令の大部分と同様に、最大で 1 つのメモリ オペランドを許可します。したがって、2 つのメモリ位置の内容を比較するには、少なくとも 1 つをレジスタにロードする必要があります。
cmp
mov cl, byte[rdi+rax] cmp cl, byte[rsi+rax]