home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
program
/
compiler
/
nasm20b
/
nasm_src
/
lib
/
src
/
hatabs.s65
< prev
next >
Wrap
Text File
|
1993-01-19
|
825b
|
39 lines
.include #system
;;; This belongs to the OS package
;;; .include #os
;;; for the setup macros
; --------------------------------------------------------------
; Find handler HATABS entry or first
; free slot:
;
; Needs:
; device ID in A
; Returns:
; Y contains index
; A device ID
; Return codes:
; C clr (BCC), Z set (BEQ) : empty slot found
; C set (BCS), Z set (BEQ) : driver found
; C set (BCS), Z clr (BNE) : HATABS full
;
; BUG: if there are duplicate handlers this will return
; the outdated one
; --------------------------------------------------------------
fhatabs ldy #0
:linst cmp hatabs,y
beq :done
clc
ldx hatabs,y
beq :done
iny
iny
iny
cpy #34 ; not 36 we don't want EQ
bcc :linst
:done rts