X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libsrc%2Fc128%2Firq.s;h=aed1f3a2595085dbaaaf2eabe117c7ab24e5b29c;hb=f16516047a551319c82debd339ded8bc2b587212;hp=aad4679688b478a5a436748cdad525f0a5c26e49;hpb=7c9171ee87a2fc26e33df4ab7e8644910abcf0dd;p=cc65 diff --git a/libsrc/c128/irq.s b/libsrc/c128/irq.s index aad467968..aed1f3a25 100644 --- a/libsrc/c128/irq.s +++ b/libsrc/c128/irq.s @@ -2,42 +2,38 @@ ; IRQ handling (C128 version) ; - .export initirq, doneirq - .import callirq + .export initirq, doneirq + .import callirq - .include "c128.inc" + .include "c128.inc" -IRQInd = $2FD ; JMP $0000 - used as indirect IRQ vector +IRQInd = $2FD ; JMP $0000 - used as indirect IRQ vector ; ------------------------------------------------------------------------ -.segment "INIT" +.segment "INIT" initirq: - lda IRQVec - ldx IRQVec+1 - sta IRQInd+1 - stx IRQInd+2 - lda #IRQStub - sei - sta IRQVec - stx IRQVec+1 - cli - rts + lda IRQVec + ldx IRQVec+1 + sta IRQInd+1 + stx IRQInd+2 + lda #IRQStub + jmp setvec ; ------------------------------------------------------------------------ .code doneirq: - lda IRQInd+1 - ldx IRQInd+2 - sei - sta IRQVec - stx IRQVec+1 - cli - rts + lda IRQInd+1 + ldx IRQInd+2 +setvec: sei + sta IRQVec + stx IRQVec+1 + cli + rts ; ------------------------------------------------------------------------ ; The C128 has ROM parallel to the RAM starting from $4000. The startup code @@ -49,15 +45,15 @@ doneirq: ; placed just above the startup code, so it goes into a RAM area that is ; not banked. -.segment "LOWCODE" +.segment "LOWCODE" IRQStub: - cld ; Just to be sure - lda MMU_CR ; Get old register value - pha ; And save on stack - lda #MMU_CFG_CC65 ; Bank 0 with kernal ROM - sta MMU_CR - jsr callirq ; Call the functions - pla ; Get old register value - sta MMU_CR - jmp IRQInd ; Jump to the saved IRQ vector + cld ; Just to be sure + lda MMU_CR ; Get old register value + pha ; And save on stack + lda #MMU_CFG_CC65 ; Bank 0 with kernal ROM + sta MMU_CR + jsr callirq ; Call the functions + pla ; Get old register value + sta MMU_CR + jmp IRQInd ; Jump to the saved IRQ vector