diff options
| author | Duncan Smith | 2010-09-14 22:50:24 -0700 |
|---|---|---|
| committer | Duncan Smith | 2010-09-14 22:50:24 -0700 |
| commit | 3759ea83b657719244d12765f5717cae576fefb5 (patch) | |
| tree | 151975ce00bbcf342a20557fe4329d84fc694981 /testbenches | |
| parent | 1f43ebf7030be20a3e559375a0ad09262ca2e1c3 (diff) | |
Conditional jumps work now.
Holy shit that was a hairy debug session. I have a lot to look
forward to.
Diffstat (limited to 'testbenches')
| -rw-r--r-- | testbenches/mine.z80 | 22 |
1 files changed, 19 insertions, 3 deletions
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: |
