mirror of
https://github.com/koute/pinky.git
synced 2025-04-02 10:31:50 -04:00
76 lines
1.3 KiB
Text
76 lines
1.3 KiB
Text
; Tests backward (negative) branch timing.
|
|
; "Branch from $XX to $YY" means that the low byte of the
|
|
; address of the branch opcode is $XX and the low byte of
|
|
; the address of the branch destination is $YY.
|
|
|
|
.include "prefix.a"
|
|
|
|
test_name:
|
|
.db "BACKWARD BRANCH TIMING",0
|
|
.code
|
|
|
|
reset:
|
|
jsr init_tests
|
|
|
|
lda #2;) Branch from $E4FD to $E4FC is too long/3)short
|
|
jsr begin_test
|
|
ldy #23
|
|
ldx #240
|
|
: jsr loop_fc
|
|
dey
|
|
bne -
|
|
jsr end_test
|
|
|
|
lda #4;) Branch from $E5FE to $E5FD is too long/5)short
|
|
jsr begin_test
|
|
ldy #20
|
|
ldx #41
|
|
: jsr loop_fd
|
|
dey
|
|
bne -
|
|
jsr end_test
|
|
|
|
lda #6;) Branch from $E700 to $E6FF is too long/7)short
|
|
jsr begin_test
|
|
ldy #20
|
|
ldx #41
|
|
: jsr loop_ff
|
|
dey
|
|
bne -
|
|
jsr end_test
|
|
|
|
lda #8;) Branch from $E801 to $E800 is too long/9)short
|
|
jsr begin_test
|
|
ldy #23
|
|
ldx #240
|
|
: jsr loop_00
|
|
dey
|
|
bne -
|
|
jsr end_test
|
|
|
|
jmp tests_passed
|
|
|
|
.org $E4FC
|
|
loop_fc:
|
|
: dex
|
|
bne -
|
|
rts
|
|
|
|
.org $E5FD
|
|
loop_fd:
|
|
: dex
|
|
bne -
|
|
rts
|
|
|
|
.org $E6FF
|
|
loop_ff:
|
|
: dex
|
|
bne -
|
|
rts
|
|
|
|
.org $E800
|
|
loop_00:
|
|
: dex
|
|
bne -
|
|
rts
|
|
|