asmjit / asmdb

Instructions database and utilities for X86/X64 and ARM (THUMB/A32/A64) architectures.
The Unlicense
327 stars 46 forks source link

call vs jmp format inconsistency #18

Open robertmuth opened 2 years ago

robertmuth commented 2 years ago

For (indirect) jmps the format is "D":

 ["jmp"              , "R:r32/m32"                                       , "D"       , "FF /4"                        , "X86 BND          Control=Jump"],
 ["jmp"              , "R:r64/m64"                                       , "D"       , "FF /4"                        , "X64 BND          Control=Jump"],

But calls the format is "M":

["call"             , "R:r16/m16"                                       , "M"       , "66 FF /2"                     , "X86 BND          Control=Call OF=U SF=U ZF=U AF=U PF=U CF=U"],
 ["call"             , "R:r32/m32"                                       , "M"       , "FF /2"                        , "X86 BND          Control=Call OF=U SF=U ZF=U AF=U PF=U CF=U"],
 ["call"             , "R:r64/m64"                                       , "M"       , "FF /2"                        , "X64 BND          Control=Call OF=U SF=U ZF=U AF=U PF=U CF=

I think it should also be "M" for indirect jmps

kobalicek commented 2 years ago

Thanks, this is a bug actually - D is a displacement encoded in the instruction, these should be all M.