pinky/nes-testsuite/roms/instr_misc/source/02-branch_wrap.s
2016-10-23 19:50:32 +02:00

37 lines
507 B
ArmAsm

; Verifies that branching past end or before beginning
; of RAM wraps around
.include "shell.inc"
main:
set_test 2,"Branch from $FF8x to $000x"
setb <0,$E8 ; INX
setb <1,$E8 ; INX
setb <2,$60 ; RTS
ldx #0
clc
jsr forward
cpx #1
jne test_failed
set_test 3,"Branch from $000x to $FFFx"
setb <0,$90 ; BCC
setb <1,-$3F
ldx #0
clc
jsr <0
cpx #1
jne test_failed
jmp tests_passed
.segment "FF00"
.res $C0
; This code is at $FFC0:
forward:
.byte $90,$3F ; BCC $3F
inx
return:
inx
rts