mirror of
https://github.com/simonowen/apple1emu.git
synced 2024-12-26 23:29:15 +00:00
- fixed TRB, which was testing the wrong register (Dr Beep)
- changed BIT #imm to only set Z flag (Jimmy) - switched to fixed 65C02 version of JMP imm, which spans pages correctly
This commit is contained in:
parent
67e3c6ef7f
commit
b1c8dcedee
180
opdefs.inc
180
opdefs.inc
@ -34,65 +34,65 @@ op_1e: equ &b41e ; +18
|
||||
op_1f: equ &bd1f ; +13
|
||||
op_20: equ &b920 ; +16
|
||||
op_21: equ &b521 ; +18
|
||||
op_22: equ &b122 ; +3
|
||||
op_22: equ &be22 ; +3
|
||||
op_23: equ &ba23 ; +3
|
||||
op_24: equ &bf24 ; +8
|
||||
op_25: equ &bc25 ; +12
|
||||
op_24: equ &b124 ; +27
|
||||
op_25: equ &bb25 ; +12
|
||||
op_26: equ &ba26 ; +13
|
||||
op_27: equ &b227 ; +9
|
||||
op_28: equ &b128 ; +25
|
||||
op_29: equ &be29 ; +10
|
||||
op_2a: equ &b32a ; +7
|
||||
op_27: equ &b327 ; +9
|
||||
op_28: equ &b228 ; +25
|
||||
op_29: equ &bc29 ; +10
|
||||
op_2a: equ &be2a ; +7
|
||||
op_2b: equ &b02b ; +3
|
||||
op_2c: equ &b72c ; +9
|
||||
op_2c: equ &bd2c ; +9
|
||||
op_2d: equ &b62d ; +13
|
||||
op_2e: equ &b02e ; +14
|
||||
op_2f: equ &bb2f ; +13
|
||||
op_30: equ &bd30 ; +8
|
||||
op_31: equ &b231 ; +22
|
||||
op_32: equ &b332 ; +20
|
||||
op_33: equ &b533 ; +3
|
||||
op_34: equ &b434 ; +10
|
||||
op_35: equ &b935 ; +14
|
||||
op_36: equ &b836 ; +15
|
||||
op_2f: equ &b72f ; +13
|
||||
op_30: equ &b830 ; +8
|
||||
op_31: equ &b331 ; +22
|
||||
op_32: equ &b432 ; +20
|
||||
op_33: equ &b933 ; +3
|
||||
op_34: equ &b534 ; +10
|
||||
op_35: equ &ba35 ; +14
|
||||
op_36: equ &b936 ; +15
|
||||
op_37: equ &bc37 ; +9
|
||||
op_38: equ &b538 ; +4
|
||||
op_39: equ &b739 ; +17
|
||||
op_3a: equ &ba3a ; +4
|
||||
op_38: equ &bb38 ; +4
|
||||
op_39: equ &b839 ; +17
|
||||
op_3a: equ &b63a ; +4
|
||||
op_3b: equ &bd3b ; +3
|
||||
op_3c: equ &bb3c ; +13
|
||||
op_3d: equ &b63d ; +17
|
||||
op_3e: equ &b53e ; +18
|
||||
op_3f: equ &ba3f ; +13
|
||||
op_3d: equ &b73d ; +17
|
||||
op_3e: equ &b63e ; +18
|
||||
op_3f: equ &b13f ; +13
|
||||
op_40: equ &b040 ; +35
|
||||
op_41: equ &b441 ; +18
|
||||
op_42: equ &b142 ; +3
|
||||
op_41: equ &b541 ; +18
|
||||
op_42: equ &b242 ; +3
|
||||
op_43: equ &bc43 ; +3
|
||||
op_44: equ &b944 ; +3
|
||||
op_45: equ &b145 ; +12
|
||||
op_46: equ &b846 ; +13
|
||||
op_47: equ &b247 ; +9
|
||||
op_48: equ &b948 ; +7
|
||||
op_49: equ &bc49 ; +10
|
||||
op_4a: equ &b74a ; +7
|
||||
op_44: equ &ba44 ; +3
|
||||
op_45: equ &b245 ; +12
|
||||
op_46: equ &b446 ; +13
|
||||
op_47: equ &ba47 ; +9
|
||||
op_48: equ &bc48 ; +7
|
||||
op_49: equ &bb49 ; +10
|
||||
op_4a: equ &bd4a ; +7
|
||||
op_4b: equ &b34b ; +3
|
||||
op_4c: equ &bd4c ; +6
|
||||
op_4d: equ &ba4d ; +13
|
||||
op_4c: equ &be4c ; +6
|
||||
op_4d: equ &b94d ; +13
|
||||
op_4e: equ &b34e ; +14
|
||||
op_4f: equ &b94f ; +13
|
||||
op_50: equ &bb50 ; +10
|
||||
op_4f: equ &b84f ; +13
|
||||
op_50: equ &ba50 ; +10
|
||||
op_51: equ &b151 ; +22
|
||||
op_52: equ &b252 ; +20
|
||||
op_53: equ &b453 ; +3
|
||||
op_54: equ &b554 ; +3
|
||||
op_55: equ &b755 ; +14
|
||||
op_56: equ &b656 ; +15
|
||||
op_57: equ &b857 ; +9
|
||||
op_58: equ &bc58 ; +6
|
||||
op_57: equ &bb57 ; +9
|
||||
op_58: equ &bd58 ; +6
|
||||
op_59: equ &b559 ; +17
|
||||
op_5a: equ &bb5a ; +8
|
||||
op_5b: equ &ba5b ; +3
|
||||
op_5c: equ &b95c ; +3
|
||||
op_5a: equ &bc5a ; +8
|
||||
op_5b: equ &b95b ; +3
|
||||
op_5c: equ &b85c ; +3
|
||||
op_5d: equ &b45d ; +17
|
||||
op_5e: equ &b35e ; +18
|
||||
op_5f: equ &b95f ; +13
|
||||
@ -130,64 +130,64 @@ op_7e: equ &b17e ; +18
|
||||
op_7f: equ &b97f ; +13
|
||||
op_80: equ &ba80 ; +10
|
||||
op_81: equ &b681 ; +14
|
||||
op_82: equ &bc82 ; +3
|
||||
op_83: equ &b283 ; +3
|
||||
op_84: equ &b384 ; +10
|
||||
op_85: equ &bc85 ; +8
|
||||
op_86: equ &b286 ; +10
|
||||
op_87: equ &bb87 ; +9
|
||||
op_88: equ &bd88 ; +6
|
||||
op_89: equ &b089 ; +25
|
||||
op_82: equ &b382 ; +3
|
||||
op_83: equ &bb83 ; +3
|
||||
op_84: equ &b284 ; +10
|
||||
op_85: equ &b385 ; +8
|
||||
op_86: equ &b086 ; +10
|
||||
op_87: equ &b787 ; +9
|
||||
op_88: equ &bb88 ; +6
|
||||
op_89: equ &ba89 ; +7
|
||||
op_8a: equ &b88a ; +5
|
||||
op_8b: equ &b48b ; +3
|
||||
op_8c: equ &b58c ; +12
|
||||
op_8d: equ &b78d ; +10
|
||||
op_8e: equ &b48e ; +12
|
||||
op_8f: equ &b38f ; +13
|
||||
op_90: equ &b690 ; +8
|
||||
op_91: equ &b191 ; +19
|
||||
op_92: equ &b292 ; +17
|
||||
op_93: equ &b893 ; +3
|
||||
op_94: equ &b994 ; +12
|
||||
op_95: equ &bb95 ; +10
|
||||
op_96: equ &b896 ; +12
|
||||
op_97: equ &bc97 ; +9
|
||||
op_98: equ &b598 ; +5
|
||||
op_99: equ &b699 ; +14
|
||||
op_9a: equ &bd9a ; +7
|
||||
op_9b: equ &b49b ; +3
|
||||
op_9c: equ &ba9c ; +11
|
||||
op_9d: equ &b59d ; +14
|
||||
op_9e: equ &b49e ; +15
|
||||
op_9f: equ &b79f ; +13
|
||||
op_a0: equ &bba0 ; +7
|
||||
op_a1: equ &b3a1 ; +15
|
||||
op_a2: equ &b9a2 ; +7
|
||||
op_a3: equ &b8a3 ; +3
|
||||
op_8b: equ &bc8b ; +3
|
||||
op_8c: equ &b48c ; +12
|
||||
op_8d: equ &b58d ; +10
|
||||
op_8e: equ &b38e ; +12
|
||||
op_8f: equ &b28f ; +13
|
||||
op_90: equ &b990 ; +8
|
||||
op_91: equ &b091 ; +19
|
||||
op_92: equ &b192 ; +17
|
||||
op_93: equ &b793 ; +3
|
||||
op_94: equ &b894 ; +12
|
||||
op_95: equ &b695 ; +10
|
||||
op_96: equ &b796 ; +12
|
||||
op_97: equ &ba97 ; +9
|
||||
op_98: equ &b498 ; +5
|
||||
op_99: equ &b599 ; +14
|
||||
op_9a: equ &bb9a ; +7
|
||||
op_9b: equ &b39b ; +3
|
||||
op_9c: equ &b99c ; +11
|
||||
op_9d: equ &b49d ; +14
|
||||
op_9e: equ &b39e ; +15
|
||||
op_9f: equ &b69f ; +13
|
||||
op_a0: equ &baa0 ; +7
|
||||
op_a1: equ &b2a1 ; +15
|
||||
op_a2: equ &b8a2 ; +7
|
||||
op_a3: equ &b1a3 ; +3
|
||||
op_a4: equ &b0a4 ; +10
|
||||
op_a5: equ &b2a5 ; +9
|
||||
op_a5: equ &b7a5 ; +9
|
||||
op_a6: equ &b1a6 ; +10
|
||||
op_a7: equ &b8a7 ; +9
|
||||
op_a8: equ &bba8 ; +5
|
||||
op_a9: equ &b9a9 ; +6
|
||||
op_aa: equ &baaa ; +5
|
||||
op_ab: equ &b5ab ; +3
|
||||
op_ac: equ &b6ac ; +12
|
||||
op_ad: equ &b7ad ; +11
|
||||
op_ae: equ &b4ae ; +12
|
||||
op_af: equ &b2af ; +13
|
||||
op_b0: equ &b3b0 ; +8
|
||||
op_a7: equ &b5a7 ; +9
|
||||
op_a8: equ &baa8 ; +5
|
||||
op_a9: equ &b8a9 ; +6
|
||||
op_aa: equ &b9aa ; +5
|
||||
op_ab: equ &bbab ; +3
|
||||
op_ac: equ &b4ac ; +12
|
||||
op_ad: equ &b6ad ; +11
|
||||
op_ae: equ &b7ae ; +12
|
||||
op_af: equ &b3af ; +13
|
||||
op_b0: equ &bab0 ; +8
|
||||
op_b1: equ &b0b1 ; +20
|
||||
op_b2: equ &b1b2 ; +18
|
||||
op_b3: equ &b5b3 ; +3
|
||||
op_b4: equ &b8b4 ; +12
|
||||
op_b5: equ &b9b5 ; +11
|
||||
op_b4: equ &b2b4 ; +12
|
||||
op_b5: equ &b8b5 ; +11
|
||||
op_b6: equ &b5b6 ; +12
|
||||
op_b7: equ &bbb7 ; +9
|
||||
op_b8: equ &bab8 ; +6
|
||||
op_b7: equ &b9b7 ; +9
|
||||
op_b8: equ &b4b8 ; +6
|
||||
op_b9: equ &b6b9 ; +15
|
||||
op_ba: equ &bcba ; +8
|
||||
op_bb: equ &b4bb ; +3
|
||||
op_ba: equ &bbba ; +8
|
||||
op_bb: equ &babb ; +3
|
||||
op_bc: equ &b3bc ; +16
|
||||
op_bd: equ &b7bd ; +15
|
||||
op_be: equ &b4be ; +16
|
||||
|
41
opimpl.inc
41
opimpl.inc
@ -325,7 +325,7 @@ i_trb_z: ld a,(de) ; TRB $nn [65C02]
|
||||
ld c,(hl) ; x
|
||||
ld a,b ; A
|
||||
cpl ; ~A
|
||||
and b ; x&~A
|
||||
and c ; x&~A
|
||||
ld (hl),a ; set mem
|
||||
ld a,c
|
||||
and b ; x&A
|
||||
@ -434,7 +434,7 @@ i_trb_a: ex de,hl ; TRB $nnnn [65C02]
|
||||
ld c,(hl) ; x
|
||||
ld a,b ; A
|
||||
cpl ; ~A
|
||||
and b ; x&~A
|
||||
and c ; x&~A
|
||||
ld (hl),a ; set mem
|
||||
ld a,c
|
||||
and b ; x&A
|
||||
@ -556,7 +556,21 @@ i_bit_z: ld a,(de) ; BIT $nn
|
||||
inc de
|
||||
ld l,a
|
||||
ld h,0
|
||||
jp i_bit
|
||||
i_bit: ld c,(hl) ; set N
|
||||
ld a,c
|
||||
and %01000000 ; V flag from bit 6 of x
|
||||
exx
|
||||
ld e,a ; set V
|
||||
exx
|
||||
ld a,(de) ; next instruction
|
||||
and %11011111
|
||||
cp &d0 ; BNE or BEQ next?
|
||||
jr z,bit_z
|
||||
jp (ix) ; main_loop ; use N flag
|
||||
bit_z: ld a,b ; A
|
||||
and c ; perform BIT test
|
||||
ld c,a ; set Z
|
||||
jp read_loop
|
||||
op_24_len: equ $-op_24
|
||||
|
||||
|
||||
@ -1557,8 +1571,8 @@ i_jmp_i: ex de,hl ; JMP (nn)
|
||||
ld d,(hl)
|
||||
ex de,hl
|
||||
ld e,(hl)
|
||||
inc l ; 6502 bug wraps within page, *OR*
|
||||
; inc hl ; 65C02 spans pages correctly
|
||||
; inc l ; 6502 bug wraps within page, *OR*
|
||||
inc hl ; 65C02 spans pages correctly
|
||||
ld d,(hl)
|
||||
jp (ix) ; main_loop
|
||||
op_6c_len: equ $-op_6c
|
||||
@ -1940,22 +1954,9 @@ op_88_len: equ $-op_88
|
||||
|
||||
org op_89
|
||||
dump $
|
||||
i_bit_i: ld h,d ; BIT #$nn
|
||||
ld l,e
|
||||
i_bit_i: ld a,(de) ; BIT #$nn
|
||||
inc de
|
||||
i_bit: ld c,(hl) ; set N
|
||||
ld a,c
|
||||
and %01000000 ; V flag from bit 6 of x
|
||||
exx
|
||||
ld e,a ; set V
|
||||
exx
|
||||
ld a,(de) ; next instruction
|
||||
and %11011111
|
||||
cp &d0 ; BNE or BEQ next?
|
||||
jr z,bit_z
|
||||
jp (ix) ; main_loop ; use N flag
|
||||
bit_z: ld a,b ; A
|
||||
and c ; perform BIT test
|
||||
and b ; BIT test against A
|
||||
ld c,a ; set Z
|
||||
jp read_loop
|
||||
op_89_len: equ $-op_89
|
||||
|
Loading…
Reference in New Issue
Block a user