Add tests for MUL instructions
authorHugo Villeneuve <hugo@hugovil.com>
Sat, 23 Nov 2013 18:58:37 +0000 (13:58 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Mon, 2 Dec 2013 01:59:50 +0000 (20:59 -0500)
tests/mul1.asm [new file with mode: 0644]
tests/mul2.asm [new file with mode: 0644]

diff --git a/tests/mul1.asm b/tests/mul1.asm
new file mode 100644 (file)
index 0000000..4e600a6
--- /dev/null
@@ -0,0 +1,16 @@
+; Test program to verify correct emu8051 operation
+;
+; Test desc: MUL AB (no overflow)
+; Test output1: ACC = 0xC2
+; Test output2: B = 0x00
+; Test output2: PSW = 0x01
+
+        CSEG
+
+        ORG     0000h           ; Reset vector
+
+        MOV     A, #061h
+        MOV     B, #002h
+        MUL     AB              ; CY should be cleared, OV should be cleared
+
+        END
diff --git a/tests/mul2.asm b/tests/mul2.asm
new file mode 100644 (file)
index 0000000..ec931d6
--- /dev/null
@@ -0,0 +1,16 @@
+; Test program to verify correct emu8051 operation
+;
+; Test desc: MUL AB (overflow)
+; Test output1: ACC = 0x5B
+; Test output2: B = 0x0B
+; Test output3: PSW = 0x05
+
+        CSEG
+
+        ORG     0000h           ; Reset vector
+
+        MOV     A, #099h
+        MOV     B, #013h
+        MUL     AB              ; CY should be cleared, OV should be cleared
+
+        END