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