intelxed / xed

The X86 Encoder Decoder (XED), is a software library for encoding and decoding X86 (IA32 and Intel64) instructions
https://intelxed.github.io/
Apache License 2.0
1.38k stars 146 forks source link

rflags reported as 32 bits wide when decoding "in eax, 0x3" instruction #320

Closed xusheng6 closed 3 months ago

xusheng6 commented 5 months ago
$ obj/wkit/examples/obj/xed-ex1 -64 e503
Attempting to decode: e5 03 
iclass IN   category IO ISA-extension BASE  ISA-set I86
instruction-length 2
operand-width 32
effective-operand-width 32
effective-address-width 64
stack-address-width 64
iform-enum-name IN_OeAX_IMMb
iform-enum-name-dispatch (zero based) 3
iclass-max-iform-dispatch 4
Nominal opcode position 0
Nominal opcode 0xe5
Operands
#   TYPE               DETAILS        VIS  RW       OC2 BITS BYTES NELEM ELEMSZ   ELEMTYPE   REGCLASS
#   ====               =======        ===  ==       === ==== ===== ===== ======   ========   ========
0   REG0              REG0=EAX   IMPLICIT   W         V   32     4     1     32        INT        GPR
1   IMM0               0x3(8b)   EXPLICIT   R         B    8     1     1      8       UINT    INVALID
2   REG1           REG1=RFLAGS SUPPRESSED   R         Y   32     4     1     32        INT      FLAGS
Memory Operands
  MemopBytes = 0
FLAGS:
   reads-rflags iopl-tst 
       read:                          iopl  mask=0x3000
    written:                                mask=0x0
  undefined:                                mask=0x0
ATTRIBUTES: NOTSX SCALABLE 
ISA SET: [I86]
kkhalail commented 3 months ago

Thanks for your report. A fix will be available with the upcoming external release.

marjevan commented 3 months ago

Solved this in https://github.com/intelxed/xed/commit/6d87b5481aa53b5ab1fc2b5a5622759c46746bf9