From 28f33d3ca429287a60545f1680d5302ffbb8571d Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sun, 24 Nov 2013 23:20:18 -0500 Subject: [PATCH] Add tests for MOV instruction --- tests/Makefile.am | 3 ++- tests/mov.asm | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 tests/mov.asm diff --git a/tests/Makefile.am b/tests/Makefile.am index 1c8547f..9080692 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -7,13 +7,14 @@ SUFFIXES = .hex .asm TESTS = \ opcodes -check_PROGRAMS = mul1.hex mul2.hex div.hex orl.hex anl.hex +check_PROGRAMS = mul1.hex mul2.hex div.hex orl.hex anl.hex mov.hex mul1.hex: mul1.asm mul2.hex: mul2.asm div.hex: div.asm orl.hex: orl.asm anl.hex: anl.asm +mov.hex: mov.asm .asm.hex: $(AS51) $< diff --git a/tests/mov.asm b/tests/mov.asm new file mode 100644 index 0000000..aacafb3 --- /dev/null +++ b/tests/mov.asm @@ -0,0 +1,22 @@ +; Test program to verify correct emu8051 operation +; +; Test desc: MOV +; Test output1: A = $66 +; Test output2: B = $98 +; Test output3: PSW = $00 +; Test output4: DPTR = $9876 +; Test output5: R0 = $66 + + CSEG + + ORG 0000h ; Reset vector + + MOV A, #099h + MOV B, A + DEC B + MOV R0, #066h + MOV A, R0 + MOV DPTR,#9876h + + LJMP 0FFF0h + END -- 2.20.1