summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAstrid Smith2010-09-13 20:30:11 -0700
committerAstrid Smith2010-09-13 20:30:11 -0700
commit4b9b3b331950e7bf993e7061189975559ce76863 (patch)
tree20b40d330109c14f246466b0f678be5294e56b4d
parent7fb7f62fd60954840815821db4a1b2d231a6ea53 (diff)
More testcases and a few fixes
-rw-r--r--opcodes.asm8
-rw-r--r--testbenches/mine.z8017
2 files changed, 21 insertions, 4 deletions
diff --git a/opcodes.asm b/opcodes.asm
index 14a0c8c..fdff23c 100644
--- a/opcodes.asm
+++ b/opcodes.asm
@@ -153,7 +153,7 @@ F_INC_B MACRO
F_DEC_B MACRO
move.b #1,f_tmp_byte-flag_storage(a3)
- st f_tmp_src_b-flag_storage(a3)
+ st f_tmp_src_b-flag_storage(a3) ;; why did I do this?
move.b \1,f_tmp_dst_b-flag_storage(a3)
subq #1,\1
F_SET #2
@@ -723,7 +723,7 @@ emu_op_3d:
emu_op_3e:
;; LD A,immed.b
FETCHBI eaf
- DONE ;nok
+ DONE
START
emu_op_3f:
@@ -1871,6 +1871,7 @@ emu_op_ca:
START
emu_op_cb: ; prefix
movea.w emu_op_undo_cb(pc),a2
+ ;; nok
START
emu_op_cc:
@@ -1889,6 +1890,7 @@ emu_op_cd:
;; PC <- address
move.l epc,a0
bsr underef ; d0 has PC
+ add.w #2,d0
PUSHW d0
bra emu_op_c3 ; JP
@@ -1929,7 +1931,7 @@ emu_op_d2:
;; JP NC,immed.w
bsr f_norm_c
beq emu_op_c3
- DONE ;nok
+ DONE
START
emu_op_d3:
diff --git a/testbenches/mine.z80 b/testbenches/mine.z80
index 2499de3..2de2861 100644
--- a/testbenches/mine.z80
+++ b/testbenches/mine.z80
@@ -3,7 +3,7 @@
.ORG 4000h
- call dec8
+ call cond_jr ;cd
halt
inc8:
@@ -17,9 +17,24 @@ inc8:
dec8:
ld a,0a5h ;3e
dec a ;3d
+ ret ;c9
+
+cond_jr:
+ ld a,01h ;3e
+ cp a ;b8
+ jr nz,wrong ;20
+
+ ccf ;3f
+ jr c,wrong ;38
+
+ scf ;37
+ jr nc,wrong ;30
ret
+wrong:
+ jp wrong
+
data8:
.db 0a5h
data16: