icedland / iced

Blazing fast and correct x86/x64 disassembler, assembler, decoder, encoder for Rust, .NET, Java, Python, Lua
MIT License
2.91k stars 232 forks source link

Wrong op access on Sub_rm16_r16 #549

Closed thug-shaker closed 5 months ago

thug-shaker commented 5 months ago

Instructions with code Sub_rm16_r16 have op0_access() set to Write and all other operands to None.

thug-shaker commented 5 months ago

image

thug-shaker commented 5 months ago

also exist on Sub_rm8_r8 as shown in the picture, only seems to happen when both operands are the same

thug-shaker commented 5 months ago

Seems to be when both operands are the same, I guess this is because it zeroes the reg. Some clarification would be appreciated. Closing for now.

wtfsck commented 5 months ago

It's because it's an xor/sub/etc reg,reg instruction. The result is always 0, so it's just a write 0 to the destination register, no input needed.