sta oldvec+1 ; Save the old vector
L1: lda #<brk_handler ; Set the break vector to our routine
+ ldx #>brk_handler
sta BRKVec
- lda #>brk_handler
- sta BRKVec+1
+ stx BRKVec+1
rts
.endproc
.proc _reset_brk
lda oldvec
- bne @L1
- ldx oldvec
+ ldx oldvec+1
beq @L9 ; Jump if vector not installed
-@L1: sta BRKVec
+ sta BRKVec
stx BRKVec+1
+ lda #$00
+ sta oldvec ; Clear the old vector
+ stx oldvec+1
@L9: rts
.endproc
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
.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
sta oldvec+1 ; Save the old vector
L1: lda #<brk_handler ; Set the break vector to our routine
+ ldx #>brk_handler
sta BRKVec
- lda #>brk_handler
- sta BRKVec+1
+ stx BRKVec+1
rts
.endproc
.proc _reset_brk
lda oldvec
- bne @L1
- ldx oldvec
+ ldx oldvec+1
beq @L9 ; Jump if vector not installed
-@L1: sta BRKVec
+ sta BRKVec
stx BRKVec+1
+ lda #$00
+ sta oldvec ; Clear the old vector
+ stx oldvec+1
@L9: rts
.endproc
sta oldvec+1 ; Save the old vector
L1: lda #<brk_handler ; Set the break vector to our routine
+ ldx #>brk_handler
sta BRKVec
- lda #>brk_handler
- sta BRKVec+1
+ stx BRKVec+1
rts
.endproc
.proc _reset_brk
lda oldvec
- bne @L1
- ldx oldvec
+ ldx oldvec+1
beq @L9 ; Jump if vector not installed
-@L1: sta BRKVec
+ sta BRKVec
stx BRKVec+1
+ lda #$00
+ sta oldvec ; Clear the old vector
+ stx oldvec+1
@L9: rts
.endproc
sta oldvec+1 ; Save the old vector
L1: lda #<brk_handler ; Set the break vector to our routine
+ ldx #>brk_handler
sta BRKVec
- lda #>brk_handler
- sta BRKVec+1
+ stx BRKVec+1
rts
.endproc
.proc _reset_brk
lda oldvec
- bne @L1
- ldx oldvec
+ ldx oldvec+1
beq @L9 ; Jump if vector not installed
-@L1: sta BRKVec
+ sta BRKVec
stx BRKVec+1
+ lda #$00
+ sta oldvec ; Clear the old vector
+ stx oldvec+1
@L9: rts
.endproc
sta oldvec+1 ; Save the old vector
L1: lda #<brk_handler ; Set the break vector to our routine
+ ldx #>brk_handler
sta BRKVec
- lda #>brk_handler
- sta BRKVec+1
+ stx BRKVec+1
rts
.endproc
.proc _reset_brk
lda oldvec
- bne @L1
- ldx oldvec
+ ldx oldvec+1
beq @L9 ; Jump if vector not installed
-@L1: sta BRKVec
+ sta BRKVec
stx BRKVec+1
+ lda #$00
+ sta oldvec ; Clear the old vector
+ stx oldvec+1
@L9: rts
.endproc