RE: BASIC and System ROM replacements

From: J.G.Harston <>
Date: Mon, 27 May 2013 12:40:14 +0100
Message-ID: <>
Baltissen, GJPAA (Ruud) wrote:
> I thought I mentioned a solution that can be used in an earlier 
> email.

Like this:

\ Interrupt veneers
\ =================
PHA:TXA:PHA:TYA:PHA:SEC        :\ Save registers, CS=IRQ
TSX:LDA &104,X                 :\ Get stacked P
AND #&10:BEQ c64irqGo          :\ BRK or IRQ
LDA #&30:STA &01               :\ Page in all RAM
JMP (BRKV)                     :\ Pass on to BRK handler
PHA:TXA:PHA:TYA:PHA:CLC        :\ Save registers, CC=NMI
LDA &01:PHA:LDA #&36:STA &01   :\ Page in Kernal and I/O
LDA #c64irqRet DIV 256:PHA     :\ Return address back to here
LDA #c64irqRet AND 255:PHA
LDA #4:PHA                     :\ Stack 'noIRQ'+'not BRK'
BCC c64nmiGo
JMP (&FFFE)                    :\ Vector to Kernal IRQ handler
JMP (&FFFA)                    :\ Vector to Kernal NMI handler
PLA:STA &01                    :\ Restore memory mapping
PLA:TAY:PLA:TAX:PLA:RTI        :\ Restore registers and return
LDA #&36:STA &01:JMP (&FFFC)   :\ Pass on to Kernal

J.G.Harston - -

       Message was sent through the cbm-hackers mailing list
Received on 2013-05-27 12:00:10

Archive generated by hypermail 2.2.0.