From 97e852595503f054a20953c1a818be4b8ff0382e Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sat, 23 Nov 2013 13:58:37 -0500 Subject: [PATCH] Add tests for MUL instructions --- tests/mul1.asm | 16 ++++++++++++++++ tests/mul2.asm | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/mul1.asm create mode 100644 tests/mul2.asm diff --git a/tests/mul1.asm b/tests/mul1.asm new file mode 100644 index 0000000..4e600a6 --- /dev/null +++ b/tests/mul1.asm @@ -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 index 0000000..ec931d6 --- /dev/null +++ b/tests/mul2.asm @@ -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 -- 2.20.1