home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / nasm20b / nasm_src / lib / src / hatabs.s65 < prev    next >
Text File  |  1993-01-19  |  825b  |  39 lines

  1.       .include #system
  2.       
  3. ;;; This belongs to the OS package
  4. ;;;     .include #os
  5. ;;; for the setup macros
  6.  
  7. ; --------------------------------------------------------------
  8. ; Find handler HATABS entry or first 
  9. ; free slot: 
  10. ;
  11. ; Needs:
  12. ;  device ID in A
  13. ; Returns:
  14. ;  Y contains index
  15. ;  A device ID
  16. ; Return codes:
  17. ;  C clr (BCC), Z set (BEQ) : empty slot found
  18. ;  C set (BCS), Z set (BEQ) : driver found
  19. ;  C set (BCS), Z clr (BNE) : HATABS full
  20. ;
  21. ; BUG: if there are duplicate handlers this will return
  22. ;      the outdated one
  23. ; --------------------------------------------------------------
  24. fhatabs ldy #0
  25. :linst cmp  hatabs,y
  26.       beq   :done
  27.       clc
  28.       ldx   hatabs,y
  29.       beq   :done
  30.       iny 
  31.       iny 
  32.       iny 
  33.       cpy   #34               ; not 36 we don't want EQ
  34.       bcc   :linst
  35. :done rts 
  36.  
  37.  
  38.  
  39.