asmjit / asmdb

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

Support for jmp, call, and ret [far] instructions #1

Open brightening-eyes opened 7 years ago

brightening-eyes commented 7 years ago

hello, as this project effect's asmjit, i've created the issue here, not in asmjit, (because asmjit get's it's instruction sets from here) some of the instructions like hlt, iret, and some others are not implemented in the asmjit if these are implemented, asmjit can be like nasm, which is used to write operating systems look at this and it should be easy to add these

kobalicek commented 7 years ago

(comment removed, contained only list of instructions not supported at the moment the issue was created)

brightening-eyes commented 7 years ago

seems everything that i need are there as i've checked, but i will look at it more

kobalicek commented 7 years ago

DB was updated, still some missing, but it's much more complete now.

lyrachord commented 6 years ago

xlatb modified:

["xlatb"            , "x:<al>,R:<es:zbx>"                                         , "NONE"    , "D7"                               , "ANY              Volatile"],
["xlatb"            , "x:<al>,R:<rbx>"                                            , "NONE"    , "REX.W D7"                         , "ANY              Volatile"],
lyrachord commented 6 years ago

After call and jmp now

    ["call"             , "rel32"                                       , "D"       , "E8 cd"                            , "ANY              Control=Call OF=U SF=U ZF=U AF=U PF=U CF=U"],
    ["call"             , "R:r32/m32"                                   , "M"       , "FF /2"                            , "X86              Control=Call OF=U SF=U ZF=U AF=U PF=U CF=U"],
    ["call"             , "R:r64/m64"                                   , "M"       , "FF /2"                            , "X64              Control=Call OF=U SF=U ZF=U AF=U PF=U CF=U"],

    ["jmp"              , "rel8"                                        , "D"       , "EB cb"                            , "ANY              Control=Jump"],
    ["jmp"              , "rel32"                                       , "D"       , "E9 cd"                            , "ANY              Control=Jump"],
    ["jmp"              , "R:r32/m32"                                   , "D"       , "FF /4"                            , "X86              Control=Jump"],
    ["jmp"              , "R:r64/m64"                                   , "D"       , "FF /4"                            , "X64              Control=Jump"],

add far version:

    ["call"             , "R:m16_16"                                    , "M"       , "FF /3"                            , "ANY              Control=Call OF=U SF=U ZF=U AF=U PF=U CF=U"],
    ["call"             , "R:m16_32"                                    , "M"       , "FF /3"                            , "ANY              Control=Call OF=U SF=U ZF=U AF=U PF=U CF=U"],
    ["call"             , "R:m16_64"                                    , "M"       , "REX.W FF /3"                      , "X64              Control=Call OF=U SF=U ZF=U AF=U PF=U CF=U"],

    ["jmp"              , "R:m16_16"                                    , "M"       , "FF /5"                            , "ANY              Control=Jump"],
    ["jmp"              , "R:m16_32"                                    , "M"       , "FF /5"                            , "ANY              Control=Jump"],
    ["jmp"              , "R:m16_64"                                    , "M"       , "REX.W FF /5"                      , "X64              Control=Jump"],
kobalicek commented 6 years ago

I added support for jmp and call [far] instructions, still have commented out some others that I don't have support for atm, but this is fixable.

kobalicek commented 6 years ago

Issue #8 now contains xlat instruction. Let's keep this one just for FAR instructions