From ce24c216aa7eaf099dda2c9efeb9603a4076c93e Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Wed, 27 Nov 2013 00:17:30 -0500 Subject: [PATCH] Change test output expected string layout Also check stack pointer value for all tests --- tests/anl.asm | 11 ++++++----- tests/div.asm | 9 +++++---- tests/mov.asm | 13 +++++++------ tests/mul1.asm | 9 +++++---- tests/mul2.asm | 9 +++++---- tests/opcodes | 2 +- tests/orl.asm | 9 +++++---- tests/timer1.asm | 29 ++++++++++++++--------------- 8 files changed, 48 insertions(+), 43 deletions(-) diff --git a/tests/anl.asm b/tests/anl.asm index fb97c17..46d383b 100644 --- a/tests/anl.asm +++ b/tests/anl.asm @@ -1,11 +1,12 @@ ; Test program to verify correct emu8051 operation ; ; Test desc: ANL -; Test output0: PC = $FFF0 -; Test output1: A = $60 -; Test output2: B = $60 -; Test output3: PSW = $E0 -; Test output4: TCON = $01 +; Test output: PC = $FFF0 +; Test output: SP = $07 +; Test output: A = $60 +; Test output: B = $60 +; Test output: PSW = $E0 +; Test output: TCON = $01 CSEG diff --git a/tests/div.asm b/tests/div.asm index 77c5a6a..ffba723 100644 --- a/tests/div.asm +++ b/tests/div.asm @@ -1,10 +1,11 @@ ; Test program to verify correct emu8051 operation ; ; Test desc: DIV AB -; Test output0: PC = $FFF0 -; Test output1: A = $3C -; Test output2: B = $00 -; Test output3: PSW = $00 +; Test output: PC = $FFF0 +; Test output: SP = $07 +; Test output: A = $3C +; Test output: B = $00 +; Test output: PSW = $00 CSEG diff --git a/tests/mov.asm b/tests/mov.asm index 9e52978..c25406a 100644 --- a/tests/mov.asm +++ b/tests/mov.asm @@ -1,12 +1,13 @@ ; Test program to verify correct emu8051 operation ; ; Test desc: MOV -; Test output0: PC = $FFF0 -; Test output1: A = $66 -; Test output2: B = $98 -; Test output3: PSW = $00 -; Test output4: DPTR = $9876 -; Test output5: R0 = $66 +; Test output: PC = $FFF0 +; Test output: SP = $07 +; Test output: A = $66 +; Test output: B = $98 +; Test output: PSW = $00 +; Test output: DPTR = $9876 +; Test output: R0 = $66 CSEG diff --git a/tests/mul1.asm b/tests/mul1.asm index 9872989..dac4bdd 100644 --- a/tests/mul1.asm +++ b/tests/mul1.asm @@ -1,10 +1,11 @@ ; Test program to verify correct emu8051 operation ; ; Test desc: MUL AB (no overflow) -; Test output0: PC = $FFF0 -; Test output1: A = $C2 -; Test output2: B = $00 -; Test output3: PSW = $01 +; Test output: PC = $FFF0 +; Test output: SP = $07 +; Test output: A = $C2 +; Test output: B = $00 +; Test output: PSW = $01 CSEG diff --git a/tests/mul2.asm b/tests/mul2.asm index a7e27c1..b0a8f71 100644 --- a/tests/mul2.asm +++ b/tests/mul2.asm @@ -1,10 +1,11 @@ ; Test program to verify correct emu8051 operation ; ; Test desc: MUL AB (overflow) -; Test output0: PC = $FFF0 -; Test output1: A = $5B -; Test output2: B = $0B -; Test output3: PSW = $05 +; Test output: PC = $FFF0 +; Test output: SP = $07 +; Test output: A = $5B +; Test output: B = $0B +; Test output: PSW = $05 CSEG diff --git a/tests/opcodes b/tests/opcodes index dc30e5e..0dba166 100755 --- a/tests/opcodes +++ b/tests/opcodes @@ -16,7 +16,7 @@ for f in *.hex; do while read line; do if echo ${line} | grep -q "; Test output"; then - test_str=$(echo ${line} | sed "s/^; Test output[0-9]: //") + test_str=$(echo ${line} | sed "s/^; Test output: //") if ! grep -q "${test_str}" ${lf}; then echo "Failed test: ${test_str}" >> ${lf} diff --git a/tests/orl.asm b/tests/orl.asm index 28da253..89f96d4 100644 --- a/tests/orl.asm +++ b/tests/orl.asm @@ -1,10 +1,11 @@ ; Test program to verify correct emu8051 operation ; ; Test desc: ORL -; Test output0: PC = $FFF0 -; Test output1: A = $60 -; Test output2: PSW = $E0 -; Test output3: TCON = $01 +; Test output: PC = $FFF0 +; Test output: SP = $07 +; Test output: A = $60 +; Test output: PSW = $E0 +; Test output: TCON = $01 CSEG diff --git a/tests/timer1.asm b/tests/timer1.asm index aacc3d5..209e199 100644 --- a/tests/timer1.asm +++ b/tests/timer1.asm @@ -1,16 +1,17 @@ ; Test program to verify correct emu8051 operation ; ; Test desc: timers -; Test output0: PC = $FFF0 -; Test output1: R0 = $22 -; Test output2: R1 = $97 -; Test output3: R2 = $20 -; Test output4: R3 = $42 -; Test output5: TIMER0 = $10DA -; Test output6: TIMER1 = $1F42 -; Test output7: TCON = $A0 -; Test output8: TMOD = $11 -; Test output9: PSW = $00 +; Test output: PC = $FFF0 +; Test output: SP = $60 +; Test output: R0 = $22 +; Test output: R1 = $97 +; Test output: R2 = $20 +; Test output: R3 = $42 +; Test output: TIMER0 = $10DA +; Test output: TIMER1 = $1F42 +; Test output: TCON = $A0 +; Test output: TMOD = $11 +; Test output: PSW = $00 TOS EQU 60h ; Adresse du dessus de la pile. @@ -19,11 +20,12 @@ TOS EQU 60h ; Adresse du dessus de la pile. ORG 0000h ; Reset vector MOV SP,#TOS ; Init stack pointer + MOV TMOD,#00010001B ; Init timers 0 and 1 as 16-bit timers, + ; incremented by the internal clock + ;; First test: no overflow MOV TH0,#2 MOV TL0,#55h ; Set initial value of timer0 to $0255 - MOV TMOD,#00010001B ; Init timers 0 and 1 as 16-bit timers, - ; incremented by the internal clock CALL DELAY MOV 00h, TH0 ; Save value of timer 0 @@ -37,9 +39,6 @@ TOS EQU 60h ; Adresse du dessus de la pile. MOV TL0,#98h ; Set initial value of timer0 to $F098 MOV Th1,#0FFh MOV TL1,#00h ; Set initial value of timer1 to $FF00 - MOV TMOD,#00010001B ; Init timers 0 and 1 as 16-bit timers, - ; incremented by the internal clock - ; Both timers should overflow CALL DELAY LJMP 0FFF0h -- 2.20.1