From dae9b96b5536dfca96dbd322d60d908df3f9e480 Mon Sep 17 00:00:00 2001 From: James Rhodes Date: Wed, 25 Apr 2012 17:36:50 +1000 Subject: [PATCH] Added partial test suite for high-nerd compliance. Added HW and TESTS folders to README. --- README.md | 6 ++++++ TESTS/high-nerd.dasm16 | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 TESTS/high-nerd.dasm16 diff --git a/README.md b/README.md index b8d95c9..eba6a86 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,15 @@ In here go all specifications and proposals for the layout and implementation of ### NET ### Anything about networking goes in the net folder. +### HW ### +Anything about hardware components and communicating directly with hardware components goes in here. + ### MISC ### In this directory goes everything that does not fit in the other directories defined above. +### TESTS ### +Tests for software that can be used to ensure standards compliance. + ## Procedures and Naming Standards ## diff --git a/TESTS/high-nerd.dasm16 b/TESTS/high-nerd.dasm16 new file mode 100644 index 0000000..a94aab0 --- /dev/null +++ b/TESTS/high-nerd.dasm16 @@ -0,0 +1,33 @@ +; +; Unit test by James Rhodes +; +; This unit test ensures emulator compliance with how high-nerd +; should work. Corrections and expansions are appreciated. +; + +; +; At the end of the test, the emulator state should be (empty +; indicates the value is unspecified): +; +; A: 0x0000 [A]: +; B: 0x0000 [B]: +; C: 0xFB50 [C]: +; X: 0x0000 [X]: +; Y: 0x0000 [Y]: +; Z: 0x0000 [Z]: +; I: 0x0000 [I]: +; J: 0x0000 [J]: +; PC: SP: 0x0000 +; EX: 0x5556 IA: 0x0000 +; + +SET C, 500 ; C = 500 +ADD C, 499 ; C = 999 +SUB C, 99 ; C = 900 +MUL C, 2 ; C = 1800 +SET A, 0xFFFF ; C = 1800, A = 0xFFFF +SUB A, C ; C = 1800, A = 0xF8F8 +SET C, A ; C = -1800, A = 0xF8F8 +SET A, 0 ; C = -1800 +MLI C, 2 ; C = -3600 +DVI C, 3 ; C = -1200 (0xFB50)