From d27ffb9c247d45ac265bda04667bb97126e9bb24 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sun, 24 Nov 2013 23:08:26 -0500 Subject: [PATCH] Add tests for ANL instruction --- tests/Makefile.am | 3 ++- tests/anl.asm | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 tests/anl.asm diff --git a/tests/Makefile.am b/tests/Makefile.am index 3d47a1d..eef5997 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -7,11 +7,12 @@ SUFFIXES = .hex .asm TESTS = \ opcodes -check_PROGRAMS = mul1.hex mul2.hex orl.hex +check_PROGRAMS = mul1.hex mul2.hex orl.hex anl.hex mul1.hex: mul1.asm mul2.hex: mul2.asm orl.hex: orl.asm +anl.hex: anl.asm .asm.hex: $(AS51) $< diff --git a/tests/anl.asm b/tests/anl.asm new file mode 100644 index 0000000..6bb5561 --- /dev/null +++ b/tests/anl.asm @@ -0,0 +1,27 @@ +; Test program to verify correct emu8051 operation +; +; Test desc: ANL +; Test output1: A = $60 +; Test output2: B = $60 +; Test output3: PSW = $E0 +; Test output4: TCON = $01 + + CSEG + + ORG 0000h ; Reset vector + + MOV PSW, #0E0h + CLR TCON.0 + CLR C + ANL C, TCON.0 ; CY Should be 0 + MOV A, PSW + + SETB TCON.0 + ANL C, TCON.0 ; CY Should be 0 + MOV B, PSW + + SETB C + ANL C, TCON.0 ; CY Should be 1 + + LJMP 0FFF0h + END -- 2.20.1