diff options
author | comex | 2015-01-16 03:24:12 -0500 |
---|---|---|
committer | comex | 2015-01-16 04:22:55 -0500 |
commit | 8fb40a9c236e58b002e447b1c8ac124732a9dd8a (patch) | |
tree | f5f32cca52ac85eecc950e573640457696616712 /lib/dis-arm-multi.inc.h | |
parent | add a test assembly file, not used yet (diff) | |
download | substitute-8fb40a9c236e58b002e447b1c8ac124732a9dd8a.tar.gz |
jump dis - seemingly working(!)
Diffstat (limited to '')
-rw-r--r-- | lib/dis-arm-multi.inc.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/dis-arm-multi.inc.h b/lib/dis-arm-multi.inc.h new file mode 100644 index 0000000..56cde35 --- /dev/null +++ b/lib/dis-arm-multi.inc.h @@ -0,0 +1,16 @@ +#include "dis-thumb.inc.h" +#include "dis-thumb2.inc.h" +#include "dis-arm.inc.h" + +static INLINE void P(dis)(tdis_ctx ctx) { + if (ctx->pc_low_bit) { + uint16_t op = *(uint16_t *) ctx->ptr; + bool is_32 = (op >> 13 & 7) == 7 && (op >> 11 & 3) != 0; + if (is_32) + return P(dis_thumb2)(ctx); + else + return P(dis_thumb)(ctx); + } else { + return P(dis_arm)(ctx); + } +} |