; Altirra Acid800 test suite ; Copyright (C) 2010 Avery Lee, All Rights Reserved. ; ; Permission is hereby granted, free of charge, to any person obtaining a copy ; of this software and associated documentation files (the "Software"), to deal ; in the Software without restriction, including without limitation the rights ; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ; copies of the Software, and to permit persons to whom the Software is ; furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ; SOFTWARE. _SAP_HEADER "CPU: Bugs" opt h+o+ icl 'library.s' org $2000 main: ldy #>testname lda #brktest beq retok ;oops... return and let the IRQ routine fail .ifndef SYS5200 pla tay pla tax pla .endif rti retok: ;check low return byte tsx .ifdef SYS5200 lda $0102,x .else lda $0105,x .endif sub #<(after+1) _ASSERTA $00, c"NMI handler executed too early or late: %x" ;check the B flag; it should be set .ifdef SYS5200 lda $0101,x .else lda $0104,x .endif and #$20 _ASSERTA $20, c"B flag was not set on entry to NMI handler." jmp _testPassed .endp .endif ;============================================================================ testname: dta c"CPU: Bugs",0 ;============================================================================ org $2400 dta $24 org $2480 jmp jmpbugok org $24ff jmpbugvec: dta $80 dta $25 org $2580 _FAIL c"JMP indirect bug not found.",0 ;============================================================================ run $2000 end