#535
Zydis Formats Invalid MASM With INTEL_MASM
TL;DR: Just use https://github.com/iximeow/yaxpeax-x86/
Zydis formats a few things in a way that MASM does not accept with INTEL_MASM:
- The
int3instruction should be formatted asint 3forCCor MASM will complain:
It will also complain about int1 but int 1 gets encoded as CD 01 instead of F1. The recommended solution is to use DB 0F1h.
test.asm(6) : error A2008: syntax error : int1
test.asm(7) : error A2008: syntax error : int3- The x87 floating-point registers
st?should be formatted asst(?):
test.asm(6) : error A2006: undefined symbol : st1- The
fucompinstruction should be formatted withoutany operandsthe implicitst(0)operand:
test.asm(6) : error A2152: coprocessor register cannot be first operandActivity
2Anyone who comes across this issue and wants a working MASM disassembler within their lifetime should check out https://github.com/iximeow/yaxpeax-x86/
#3 is related to #189. Error message is actually misleading e.g.
fucomp st(1)is totally fine. MASM doesn't likefucomp st(0), st(N)syntax because it considersst(0)implicit and Zydis treats both as visible operands.I've listed all instructions with implicit
st(0)as first operand and ran them throughml64.exeshipped with VS2022:Seems like
fucompis the only one MASM dislikes.