From ee1f6c47e1eff920068f4bceaf604f9535a2e8a9 Mon Sep 17 00:00:00 2001 From: Wojciech Kosior Date: Tue, 1 Sep 2020 10:54:59 +0200 Subject: start anew --- tests/stack_machine_sub/instructions.s.tcl | 21 +++++++++++++++++++++ tests/stack_machine_sub/test.v | 1 + tests/stack_machine_sub/words_to_verify.mem | 9 +++++++++ 3 files changed, 31 insertions(+) create mode 100755 tests/stack_machine_sub/instructions.s.tcl create mode 120000 tests/stack_machine_sub/test.v create mode 100644 tests/stack_machine_sub/words_to_verify.mem (limited to 'tests/stack_machine_sub') diff --git a/tests/stack_machine_sub/instructions.s.tcl b/tests/stack_machine_sub/instructions.s.tcl new file mode 100755 index 0000000..3f8fb48 --- /dev/null +++ b/tests/stack_machine_sub/instructions.s.tcl @@ -0,0 +1,21 @@ +#!/usr/bin/env tclsh + +source tclasm.tcl + +### store 2 values to memory, load them back, substract them and store the +### result; this is analogous to addition test + +set_sp h7FFFC +const 68996288 +store@ h1EEE0 +const 540904416 +store@ h1EEE4 + +load@ h1EEE0 +stack down +load@ h1EEE4 +# substracting 540904416 from 68996288 should yield -471908128 +sub +stack up +store@ h1EEE8 +halt diff --git a/tests/stack_machine_sub/test.v b/tests/stack_machine_sub/test.v new file mode 120000 index 0000000..f5b6a59 --- /dev/null +++ b/tests/stack_machine_sub/test.v @@ -0,0 +1 @@ +../stack_machine_store/test.v \ No newline at end of file diff --git a/tests/stack_machine_sub/words_to_verify.mem b/tests/stack_machine_sub/words_to_verify.mem new file mode 100644 index 0000000..cc666fa --- /dev/null +++ b/tests/stack_machine_sub/words_to_verify.mem @@ -0,0 +1,9 @@ +// address value + 1EEE0 CCC0 // 68996288 in hex is 41CCCC0 + 1EEE2 41C + + 1EEE4 8BE0 // 540904416 in hex is 203D8BE0 + 1EEE6 203D + + 1EEE8 40E0 // -471908128 in hex is E3DF40E0 + 1EEEA E3DF -- cgit v1.2.3