]> git.sur5r.net Git - cc65/blobdiff - libsrc/atari/break.s
The spans do now contain the size of a span, no longer the end offset.
[cc65] / libsrc / atari / break.s
index b1b58c831d3f42c53c511aa62944914bd8651ca0..ebad1cb3d9dfc5ac646d7526e59486cc7ad017a9 100644 (file)
@@ -36,7 +36,7 @@ uservec:      jmp     $FFFF           ; Patched at runtime
 
        lda     oldvec
        ora     oldvec+1        ; Did we save the vector already?
-               bne     L1              ; Jump if we installed the handler already
+       bne     L1              ; Jump if we installed the handler already
 
        lda     VBREAK
        sta     oldvec
@@ -56,12 +56,14 @@ L1: lda     #<brk_handler   ; Set the break vector to our routine
 .proc  _reset_brk
 
        lda     oldvec
-       bne     @L1
-       ldx     oldvec
+       ldx     oldvec+1
        beq     @L9             ; Jump if vector not installed
-@L1:   sta     VBREAK
+       sta     VBREAK
        stx     VBREAK+1
-@L9:   rts
+       lda     #$00
+       sta     oldvec          ; Clear the old vector
+       stx     oldvec+1
+@L9:   rts     
 
 .endproc