From 3759ea83b657719244d12765f5717cae576fefb5 Mon Sep 17 00:00:00 2001 From: Duncan Smith Date: Tue, 14 Sep 2010 22:50:24 -0700 Subject: Conditional jumps work now. Holy shit that was a hairy debug session. I have a lot to look forward to. --- testbenches/mine.z80 | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'testbenches') diff --git a/testbenches/mine.z80 b/testbenches/mine.z80 index aa33fb5..57c6998 100644 --- a/testbenches/mine.z80 +++ b/testbenches/mine.z80 @@ -3,7 +3,7 @@ .ORG 4000h - call cond_jr ;cd + call cond_jr_no ;cd halt ;76 inc8: @@ -19,7 +19,8 @@ dec8: dec a ;3d ret ;c9 -cond_jr: + ;; Test jump-not-taken of JR [C,NC,Z] +cond_jr_no: ld a,01h ;3e 01 cp a ;bf jr nz,wrong ;20 07 @@ -31,10 +32,25 @@ cond_jr: jr nc,wrong ;30 ret ;c9 - wrong: jp wrong + ;; Test jump-taken of JR [C,NC,Z] +cond_jr_yes: + ld a,01h ;3e 01 + ld b,02h ;06 02 + cp b ;b8 + jr nz,right1 ;20 + jp wrong +right1: scf ;37 + jr c,right2 ;38 + jp wrong +right2: ccf ;3f + jr nc,right3 ;30 + jp wrong +right3: ret ;c9 + + data8: .db 0a5h data16: -- cgit v1.2.3