mirror of
https://github.com/daniel5151/ANESE.git
synced 2025-04-02 10:32:00 -04:00
65 lines
803 B
ArmAsm
Executable file
Vendored
65 lines
803 B
ArmAsm
Executable file
Vendored
CUSTOM_IRQ=1
|
|
.include "shell.inc"
|
|
|
|
irq: pla
|
|
pha
|
|
rti
|
|
|
|
jmp_6ff:
|
|
.byte $6C ; JMP ($6FF) (to avoid warning)
|
|
.word $6FF
|
|
|
|
main:
|
|
setb SNDMODE,$40 ; disable frame IRQ
|
|
|
|
set_test 3,"JMP ($6FF) should get high byte from $600"
|
|
setb $6FF,$F0
|
|
setb $600,$07
|
|
setb $700,$06
|
|
setb $7F0,$E8 ; INX
|
|
setb $7F1,$60 ; RTS
|
|
setb $6F0,$60 ; RTS
|
|
ldx #0
|
|
jsr jmp_6ff
|
|
cpx #1
|
|
jne test_failed
|
|
|
|
set_test 4,"RTI should return to addr"
|
|
lda #>:+
|
|
pha
|
|
lda #<:+
|
|
pha
|
|
ldx #0
|
|
php
|
|
rti
|
|
inx
|
|
: inx
|
|
inx
|
|
cpx #2
|
|
jne test_failed
|
|
|
|
set_test 5,"BRK should push status with bits 4 and 5 set"
|
|
lda #$00
|
|
pha
|
|
plp
|
|
brk
|
|
nop
|
|
cmp #$30
|
|
jne test_failed
|
|
lda #$FF
|
|
pha
|
|
plp
|
|
brk
|
|
nop
|
|
cmp #$FF
|
|
jne test_failed
|
|
|
|
set_test 6,"BRK should push address BRK + 2"
|
|
ldx #1
|
|
brk
|
|
inx
|
|
inx
|
|
cpx #2
|
|
jne test_failed
|
|
|
|
jmp tests_passed
|