Commit Graph

227 Commits

Author SHA1 Message Date
Jaysonicc 9b0a882a0e
fix build android (#1765)
* Update make.sh

fix build android

* Update Makefile

fix build android
2021-06-13 21:28:57 +08:00
Sebastian Macke 9baa0751ca MOS65XX: Fix instruction length for indirect addressing modes (#1402)
Signed-off-by: Sebastian Macke <sebastian@macke.de>
2019-02-28 06:12:52 +08:00
david942j 0b37390f49 Fix typos of MOS65XX (#1390)
* Fix typos

* make test_mos65xx.py and test_mos65xx.c have same output format

* mox65xx -> mos65xx
2019-02-18 19:52:51 +08:00
Scott Knight 4b4a848027 Print EFLAGS and FPU_FLAGS correctly in test_x86 (#1365)
* Print EFLAGS and FPU_FLAGS correctly in test_x86

Since the eflags and fpu_flags are union the instruction group needs
to be checked for FPU to see if the flag is an FPU flag. cstool_x86
was already doing this but test_x86 was not. The result was the fadd
instruction from the x86  16bit test was showing in the test_x86
output as having eflags. Since fadd is an fpu instruction the FPU_FLAGS
should be shown instead.

* Remove extra newline in instruction output

All of the other test_<arch>.c functions print a single newline after
the dissassembly. x86 had two newlines. This makes test_x86
consistent with all the other test output.
2019-02-05 09:43:04 +08:00
Scott Knight 65cad8cc7b Fix CAPSTONE_HAS_PPC flags (#1361)
The actual conditional PPC flag used is CAPSTONE_HAS_POWERPC. It
appears as if some of the test suite files was using the incorrect flag. Because
of this test_basic, test_detail and test_iter were all failing to output PPC
code in the default configuration.
2019-02-03 09:34:18 +08:00
Erik Hemming 5fdc7de0d9 Fix a couple of corner-cases with rarely used m68k instructions. (#1344)
* Bump the "cs_insn.bytes[]" size to 24 (from 16) to support M680x0 instructions with full EA (maximum 11 words)
Added a test for this in test_m68k.s

* Bump the "cs_detail.regs_read[]" size to 16 (from 12) to support M680x0 instructions with full REG_BITS (Dn+An = 16)

* m68k: use immediate mode syntax (#$0) for movem/fmovem instructions with empty register list

* update bindings to match changes to cs_insn and cs_detail
2019-01-21 17:42:28 +08:00
Nguyen Anh Quynh deb9a3c415 Merge branch 'master' into next 2018-12-20 22:34:29 +08:00
Nelson Chen 02497b1c80 Normalize IS_MINGW checks (and include MSYS, like main Makefile) (#1318)
Following in the steps of #1290
2018-12-20 15:09:27 +08:00
Nguyen Anh Quynh 6318f623f1 tests: add MOS65XX sample to test_basic.c 2018-12-16 20:14:07 +08:00
Nguyen Anh Quynh 3933674e62 mos65xx: solve conflicts 2018-12-16 20:09:28 +08:00
Sebastian Macke 87221fa742 Add support for the MOS65XX family such as the MOS 6502.
Signed-off-by: Sebastian Macke <sebastian@macke.de>
2018-12-06 22:53:33 +01:00
Nguyen Anh Quynh 740f05b62d fix warnings on const char * discards qualifiers 2018-07-24 12:22:10 +08:00
Nguyen Anh Quynh 2fc852dcbd fix warnings on const char * discards qualifiers 2018-07-24 01:41:59 +08:00
Stephen Eckels dce7da98f8 Merges encoding to next (#1194)
* merge encoding branch into next branch

* added python bindings and updated test to support encoding

* fix python import

* fix py binding fields

* fix disp size printing

* fixed py binding, again

* Update CREDITS.TXT

* fixed formatting and a cast

* Changed param from int to uint8_t, fixed warnings
2018-07-04 22:47:55 +08:00
Nguyen Anh Quynh 863ec0aba8 EVM: add missing files 2018-03-31 17:32:22 +08:00
Nguyen Anh Quynh ed1246d79b add Ethereum VM architecture 2018-03-31 17:29:22 +08:00
Nguyen Anh Quynh 0f3dc67430 tests: fix warning on unused var in test_skipdata.c 2018-02-19 11:46:53 +08:00
Nguyen Anh Quynh 1af1e412b7 fix tests & cstool, so we can compile on MSVC 2010 2018-02-14 15:02:05 +08:00
Nguyen Anh Quynh d19cedc514 sparc: change imm type from int32_t to int64_t 2017-12-27 14:46:47 +08:00
Wolfgang Schwotzer 22b4d0eb41 M680X: Target ready for pull request (#1034)
* Added new M680X target. Supports M6800/1/2/3/9, HD6301

* M680X: Reformat for coding guide lines. Set alphabetical order in HACK.TXT

* M680X: Prepare for python binding. Move cs_m680x, m680x_insn to m680x_info. Chec
> k cpu type, no default.

* M680X: Add python bindings. Added python tests.

* M680X: Added cpu types to usage message.

* cstool: Avoid segfault for invalid <arch+mode>.

* Make test_m680x.c/test_m680x.py output comparable (diff params: -bu). Keep xprint.py untouched.

* M680X: Update CMake/make for m680x support. Update .gitignore.

* M680X: Reduce compiler warnings.

* M680X: Reduce compiler warnings.

* M680X: Reduce compiler warnings.

* M680X: Make test_m680x.c/test_m680x.py output comparable (diff params: -bu).

* M680X: Add ocaml bindings and tests.

* M680X: Add java bindings and tests.

* M680X: Added tests for all indexed addressing modes. C/Python/Ocaml

* M680X: Naming, use page1 for PAGE1 instructions (without prefix).

* M680X: Naming, use page1 for PAGE1 instructions (without prefix).

* M680X: Used M680X_FIRST_OP_IN_MNEM in tests C/python/java/ocaml.

* M680X: Added access property to cs_m680x_op.

* M680X: Added operand size.

* M680X: Remove compiler warnings.

* M680X: Added READ/WRITE access property per operator.

* M680X: Make reg_inherent_hdlr independent of CPU type.

* M680X: Add HD6309 support + bug fixes

* M680X: Remove errors and warning.

* M680X: Add Bcc/LBcc to group BRAREL (relative branch).

* M680X: Add group JUMP to BVS/BVC/LBVS/LBVC. Remove BRAREL from BRN/LBRN.

* M680X: Remove LBRN from group BRAREL.

* M680X: Refactored cpu_type initialization for better readability.

* M680X: Add two operands for insn having two reg. in mnemonic. e.g. ABX.

* M680X: Remove typo in cstool.c

* M680X: Some format improvements in changed_regs.

* M680X: Remove insn id string list from tests (C/python/java/ocaml).

* M680X: SEXW, set access of reg. D to WRITE.

* M680X: Sort changed_regs in increasing m680x_insn order.

* M680X: Add M68HC11 support + Reduced from two to one INDEXED operand.

* M680X: cstool, also write '(in mnemonic)' for second reg. operand.

* M680X: Add BRN/LBRN to group JUMP and BRAREL.

* M680X: For Bcc/LBcc/BRSET/BRCLR set reg. CC to read access.

* M680X: Correctly print negative immediate values with option CS_OPT_UNSIGNED.

* M680X: Rename some instruction handlers.

* M680X: Add M68HC05 support.

* M680X: Dont print prefix '<' for direct addr. mode.

* M680X: Add M68HC08 support + resorted tables + bug fixes.

* M680X: Add Freescale HCS08 support.

* M680X: Changed group names, avoid spaces.

* M680X: Refactoring, rename addessing mode handlers.

* M680X: indexed addr. mode, changed pre/post inc-/decrement representation.

* M680X: Rename some M6809/HD6309 specific functions.

* M680X: Add CPU12 (68HC12/HCS12) support.

* M680X: Correctly display illegal instruction as FCB .

* M680X: bugfix: BRA/BRN/BSR/LBRA/LBRN/LBSR does not read CC reg.

* M680X: bugfix: Correctly check for sufficient code size for M6809 indexed addressing.

* M680X: Better support for changing insn id within handler for addessing mode.

* M680X: Remove warnings.

* M680X: In set_changed_regs_read_write_counts use own access_mode.

* M680X: Split cpu specific tables into separate *.inc files.

* M680X: Remove warnings.

* M680X: Removed address_mode. Addressing mode is available in operand.type

* M680X: Bugfix: BSET/BCLR/BRSET/BRCLR correct read/modify CC reg.

* M680X: Remove register TMP1. It is first visible in CPU12X.

* M680X: Performance improvement + bug fixes.

* M680X: Performance improvement, make cpu_tables const static.

* M680X: Simplify operand decoding by using two handlers.

* M680X: Replace M680X_OP_INDEX by M680X_OP_CONSTANT + bugfix in java/python/ocaml bindings.

* M680X: Format with astyle.

* M680X: Update documentation.

* M680X: Corrected author for m680x specific files.

* M680X: Make max. number of architectures single source.
2017-10-21 21:44:36 +08:00
Francesco Tamagni 1fb2b53620 Add CS_MODE_MIPS2 to opt-in for COP3 instructions (#939)
* Add CS_MODE_MIPS2 to opt-in for COP3 instructions

* Fix indentation

* Get rid of `+`
2017-06-27 20:56:54 +08:00
Nguyen Anh Quynh ae34c9b58b Merge branch 'next2' into next 2017-04-17 21:27:26 +08:00
Nguyen Anh Quynh cc8cc60ce0 cleanup 2017-04-17 10:02:37 +08:00
Fotis Loukos bbc5fe3fe6 Fixed myinttypes.h 2017-04-14 17:40:53 +03:00
Fotis Loukos 0a159f1865 TMS320C64x support at tests and const generator. 2017-04-14 17:03:28 +03:00
Fotis Loukos 0850d55211 Added support for the TMS320C64x architecture. 2017-04-14 17:00:40 +03:00
Nguyen Anh Quynh ef4a2dbccc tests: cleanup 2016-10-17 14:42:32 +08:00
Satoshi Tanda 565b6c3363 fix typo, style
Signed-off-by: Satoshi Tanda <tanda.sat@gmail.com>
2016-09-28 07:33:14 -07:00
Akihiko Odaki 958ba656e9 arm: treat ARM address as unsigned
It should be unsigned because:
* It does arithmetic operations
* Format strings have "%u" instead of "%d"

# Conflicts:
#	arch/ARM/ARMInstPrinter.c
#	bindings/python/test_arm.py
#	tests/test_arm.c
2016-09-04 00:13:50 +09:00
Nguyen Anh Quynh bf2690afca Merge pull request #696 from emoon/m68k-reg-read-write
[M68K] Implemented regs read/write lists
2016-08-11 11:22:48 +08:00
Daniel Collin aaf2c49015 [M68K] Implemented regs read/write lists 2016-08-09 17:29:36 +02:00
Niels Boehm 7d4c660959 Fix typo in m68k constant for immediate operand. 2016-06-15 08:25:59 +02:00
Nguyen Anh Quynh d6e0d6a049 tests: minor fix for test_arm64.c 2016-05-22 12:10:54 +08:00
tandasat ff428f8bd7 Merge remote-tracking branch 'upstream/next' into next 2016-05-16 20:36:48 -07:00
tandasat f7fe640bd0 port #684 to the next branch 2016-05-16 20:32:36 -07:00
Inokentiy Babushkin 53b8174c6a Further refinements to the tests + python test fix for M68K 2016-05-13 18:39:32 +02:00
tandasat e6fd7ac249 Merge remote-tracking branch 'upstream/next' into next 2016-05-13 07:38:42 -07:00
Inokentiy Babushkin fc4488b68e Reduced confusion caused by the m68k test being out of date
* added a new case branch to account for floating point operands.
2016-05-13 09:08:36 +02:00
tandasat c45f1db564 Merge remote-tracking branch 'upstream/next' into next 2016-05-11 22:52:34 -07:00
tandasat 45e5eab646 port Windows driver support 2016-05-11 21:48:32 -07:00
Inokentiy Babushkin a19fd65974 Fixed trivial (all) compiler warnings
Some enumeration compares were using the wrong (but in this case
harmless) enumeration in the test suite. Replaced to make the compiler
happy.
2016-05-08 23:25:58 +02:00
Ruslan Kabatsayev cbf5d3d440 Remove never used cs_x86_op::fp 2016-04-23 14:45:24 +03:00
Daniel Collin 988bb63113 [M68K] Added basic groups
Added support for basic groups in the M68K backend. Also did some minor cleanups/whitespace fixes while at it.

Relates to this issue https://github.com/aquynh/capstone/issues/494
2016-04-10 10:55:21 +02:00
Nguyen Anh Quynh 9031b17fe0 arm64: indentation 2016-01-22 22:37:59 +08:00
Pranith Kumar 653827bf5a Add register access info for ARM64
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
2016-01-06 15:54:10 -05:00
Nicolas PLANEL fa1ad4ca9d [tests] test_m68k.c fixup some minors output glitch
Minors glitch fixup and/or output consmetics.
2015-10-06 16:10:22 +11:00
Nicolas PLANEL ce68098765 [tests] avoid overlap i variable namespace
Avoir overlaping of i variable name as already use as platform index.
2015-10-06 15:00:45 +11:00
Nguyen Anh Quynh b16658d39e m68k: add M68K code to test_basic.c & test_detail.c 2015-10-04 15:05:26 +08:00
Daniel Collin cd206ff508 Made test_m68k a bit more verbose 2015-10-03 09:58:27 +02:00
Daniel Collin 2ee675c10a This adds M68K support to Capstone 2015-10-02 20:47:00 +02:00