From ce511a5e54f0106f0765d64476b9c30bc39b9d01 Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Sun, 6 Jan 2019 08:24:15 +0100 Subject: [PATCH] Add example tests --- .../dsp_instruction_tests/code-test.json | 15 +++++++++++++++ .../dsp_instruction_tests/inc_a-test.json | 15 +++++++++++++++ .../dsp_instruction_tests/memory-test.json | 13 +++++++++++++ .../dsp_instruction_tests/registers-test.json | 16 ++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 python-scripts/dsp_instruction_tests/code-test.json create mode 100644 python-scripts/dsp_instruction_tests/inc_a-test.json create mode 100644 python-scripts/dsp_instruction_tests/memory-test.json create mode 100644 python-scripts/dsp_instruction_tests/registers-test.json diff --git a/python-scripts/dsp_instruction_tests/code-test.json b/python-scripts/dsp_instruction_tests/code-test.json new file mode 100644 index 0000000..00c36ed --- /dev/null +++ b/python-scripts/dsp_instruction_tests/code-test.json @@ -0,0 +1,15 @@ +{ + "input": { + "a2": "0x00", + "a1": "0x000000", + "a0": "0x000000" + }, + "code": [ + "move #$12, a2", + "move #$345678, a1", + "move #$9ABCDE, a0" + ], + "output": [ + "a2","a1","a0" + ] +} diff --git a/python-scripts/dsp_instruction_tests/inc_a-test.json b/python-scripts/dsp_instruction_tests/inc_a-test.json new file mode 100644 index 0000000..8e9eb7b --- /dev/null +++ b/python-scripts/dsp_instruction_tests/inc_a-test.json @@ -0,0 +1,15 @@ +{ + "input": { + "a2": "0x00", + "a1": "0x000000", + "a0": "0x000000" + }, + "code": [ + ":0x000008", "; inc a" + ], + "output": [ + "a2", + "a1", + "a0" + ] +} diff --git a/python-scripts/dsp_instruction_tests/memory-test.json b/python-scripts/dsp_instruction_tests/memory-test.json new file mode 100644 index 0000000..eb14bd4 --- /dev/null +++ b/python-scripts/dsp_instruction_tests/memory-test.json @@ -0,0 +1,13 @@ +{ + "input": { + "x:$10": ["0xFF0012","0x123456"], + "x:$20": ["0x789ABC"] + }, + "code": [ + "move x:$10, x0", + "move x0, x:$20" + ], + "output": [ + "x0" + ] +} diff --git a/python-scripts/dsp_instruction_tests/registers-test.json b/python-scripts/dsp_instruction_tests/registers-test.json new file mode 100644 index 0000000..982373b --- /dev/null +++ b/python-scripts/dsp_instruction_tests/registers-test.json @@ -0,0 +1,16 @@ +{ + "input": { + "a2": "0x00", "a1": "0x000000", "a0": "0x000000" + }, + "code": [], + "output": [ + "vba", "sr", "omr", "sp", "ssh", "ssl", "la", "lc", + "a2","a1","a0", + "b2","b1","b0", + "x0", "x1", + "y0", "y1", + "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", + "m0", "m1", "m2", "m3", "m4", "m5", "m6", "m7", + "n0", "n1", "n2", "n3", "n4", "n5", "n6", "n7" + ] +}