about summary refs log tree commit diff stats
path: root/test/arch/mep/asm/test_major_opcode_9.py
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2018-07-13 10:20:21 +0200
committerGitHub <noreply@github.com>2018-07-13 10:20:21 +0200
commitcc9c0c70af3a91157226440ae3b64199711ee0db (patch)
tree932dd2676afcf0c4ba6bf0c57d3b574954461ad2 /test/arch/mep/asm/test_major_opcode_9.py
parent82eb5f6eb197fc59d2e9ae21cfda05a1868e462e (diff)
parentb8e5038798b0dece628846acb5ad25d9d4e60395 (diff)
downloadmiasm-cc9c0c70af3a91157226440ae3b64199711ee0db.tar.gz
miasm-cc9c0c70af3a91157226440ae3b64199711ee0db.zip
Merge pull request #763 from guedou/Toshiba_MeP-c4
Toshiba MeP support
Diffstat (limited to 'test/arch/mep/asm/test_major_opcode_9.py')
-rw-r--r--test/arch/mep/asm/test_major_opcode_9.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/arch/mep/asm/test_major_opcode_9.py b/test/arch/mep/asm/test_major_opcode_9.py
new file mode 100644
index 00000000..822f3b6a
--- /dev/null
+++ b/test/arch/mep/asm/test_major_opcode_9.py
@@ -0,0 +1,24 @@
+# Toshiba MeP-c4 - Major Opcode #9 unit tests
+# Guillaume Valadon <guillaume@valadon.net>
+
+from ut_helpers_asm import check_instruction
+
+
+class TestMajor9:
+
+    def test_ADD3(self):
+        """Test the ADD3 instruction"""
+
+        # Top instructions
+        check_instruction("ADD3 $10, $4, $0", "940a")
+        check_instruction("ADD3 $3, $0, $0", "9003")
+        check_instruction("ADD3 $12, $4, $0", "940c")
+        check_instruction("ADD3 $7, $12, $0", "9c07")
+        check_instruction("ADD3 $TP, $4, $0", "940d")
+
+        # Randomly choosen instructions
+        check_instruction("ADD3 $4, $1, $9", "9194")
+        check_instruction("ADD3 $7, $12, $9", "9c97")
+        check_instruction("ADD3 $12, $9, $SP", "99fc")
+        check_instruction("ADD3 $12, $TP, $7", "9d7c")
+        check_instruction("ADD3 $4, $8, $SP", "98f4")