mirror of
https://github.com/a2stuff/prodos-drivers.git
synced 2024-12-21 14:29:18 +00:00
49 lines
1.2 KiB
ArmAsm
49 lines
1.2 KiB
ArmAsm
|
|
||
|
.setcpu "6502"
|
||
|
.linecont +
|
||
|
.feature string_escapes
|
||
|
|
||
|
.include "apple2.inc"
|
||
|
.include "apple2.mac"
|
||
|
|
||
|
.include "../inc/apple2.inc"
|
||
|
.include "../inc/macros.inc"
|
||
|
.include "../inc/prodos.inc"
|
||
|
|
||
|
;;; ************************************************************
|
||
|
.include "../inc/driver_preamble.inc"
|
||
|
;;; ************************************************************
|
||
|
|
||
|
.proc maybe_install_driver
|
||
|
;; Find the current device's index in the list
|
||
|
ldx #0
|
||
|
: lda DEVLST,x
|
||
|
and #$F0
|
||
|
cmp DEVNUM
|
||
|
beq found
|
||
|
inx
|
||
|
cpx DEVCNT
|
||
|
bcc :-
|
||
|
bcs exit ; last one or not found
|
||
|
|
||
|
;; Save it
|
||
|
found: ldy DEVLST,x
|
||
|
|
||
|
;; Move everything up
|
||
|
: lda DEVLST+1,x
|
||
|
sta DEVLST,x
|
||
|
inx
|
||
|
cpx DEVCNT
|
||
|
bne :-
|
||
|
|
||
|
;; Place it at the end
|
||
|
tya
|
||
|
sta DEVLST,x
|
||
|
|
||
|
exit: rts
|
||
|
.endproc
|
||
|
|
||
|
;;; ************************************************************
|
||
|
.include "../inc/driver_postamble.inc"
|
||
|
;;; ************************************************************
|