From: Hugo Villeneuve Date: Mon, 25 Nov 2013 04:14:46 +0000 (-0500) Subject: Add tests for DIV instruction X-Git-Tag: v2.0.0~49 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=0315df659787152155a3265a3ea8c544dfd37757;p=emu8051.git Add tests for DIV instruction --- diff --git a/tests/Makefile.am b/tests/Makefile.am index eef5997..1c8547f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -7,10 +7,11 @@ SUFFIXES = .hex .asm TESTS = \ opcodes -check_PROGRAMS = mul1.hex mul2.hex orl.hex anl.hex +check_PROGRAMS = mul1.hex mul2.hex div.hex orl.hex anl.hex mul1.hex: mul1.asm mul2.hex: mul2.asm +div.hex: div.asm orl.hex: orl.asm anl.hex: anl.asm diff --git a/tests/div.asm b/tests/div.asm new file mode 100644 index 0000000..116c3e2 --- /dev/null +++ b/tests/div.asm @@ -0,0 +1,22 @@ +; Test program to verify correct emu8051 operation +; +; Test desc: DIV AB +; Test output1: A = $3C +; Test output2: B = $00 +; Test output3: PSW = $00 + + CSEG + + ORG 0000h ; Reset vector + + MOV A, #0FFh + MOV B, #00h + DIV AB ; CY should be cleared, OV should be set + ; PSW = $04 + + MOV A, #240 ; 240d + MOV B, PSW ; 4d + DIV AB ; CY should be cleared, OV should be cleared, result = 10 + + LJMP 0FFF0h + END