From 8a11b3772580e5577a337439e7dd12f27ea33f06 Mon Sep 17 00:00:00 2001 From: astoria-d Date: Sat, 7 Sep 2013 13:00:03 +0900 Subject: [PATCH] - bug fixed for code page crossing & relative branch page corssing mixed case - test case for the above bug added. --- simulation/cpu/decoder.vhd | 1 + tools/test-image/sample1.asm | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/simulation/cpu/decoder.vhd b/simulation/cpu/decoder.vhd index 06b0689..abcc690 100644 --- a/simulation/cpu/decoder.vhd +++ b/simulation/cpu/decoder.vhd @@ -2759,6 +2759,7 @@ end procedure; --disable previous we_n gate. --t1 cycle is fetch low oprand. dl_al_we_n <= '1'; + dl_ah_we_n <= '1'; elsif ('0' & exec_cycle(4 downto 0) = T3) then --t2 cycle is fetch high oprand. dl_ah_we_n <= '1'; diff --git a/tools/test-image/sample1.asm b/tools/test-image/sample1.asm index e9cfa48..4c94b30 100644 --- a/tools/test-image/sample1.asm +++ b/tools/test-image/sample1.asm @@ -28,6 +28,33 @@ lda #$00 sta $2006 + ;;;carry flag set. + lda #$ff + adc #$01 + jmp branch_boundary_test1 + ;;fill dummy data to test page boundary instruction. + .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f + .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f + .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f + .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f + .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f + .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f + .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f + .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f + .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f + .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f + .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f + .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f + .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f + .byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f + .byte $00 + ;;;single byte instruction page boundary test. +branch_boundary_test1: + BCS br_ad1 + AND #$fb ;;this is skipped. +br_ad1: + STA $2000 + ;;dma test data. ldy #$00 ldx #$41 -- 2.11.0