ufddos.inc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ;; DOS variables
  2. defc DOSFD = 64768 ;; Current DOS file descriptor
  3. defc DRVSEL = 64769 ;; Selected drive no
  4. defc DOSBUF0 = 64786 ;; Pointer to DOSBUF 0
  5. defc DISKERR = 64789 ;; Drive error (if any)
  6. defc BCSAVE = 64797 ;; Register save area
  7. defc DOSDEFDEV = 64821 ;; DOS default device (" ") in RAM
  8. defc DOSFD0 = 64832 ;; DOS file descriptor table
  9. ;; DOS subroutines and pointers
  10. defc DCWAI = 24672 ;; Select drive
  11. defc DW0 = 24675 ;; Write sector to DOSBUF0
  12. defc DR0 = 24678 ;; Read sector from DOSBUF0
  13. defc DDEVDES = 24683 ;; Pointer to DOS device type list
  14. defc DRDWRET = 24689 ;; Pointer to driver hook
  15. defc DRDWEND = 25012 ;; Driver hook exit (when claimed)
  16. defc DRDWERR = 25011 ;; Driver hook exit on error
  17. defc DGETBUF = 25098 ;; Get address of DOSBUF B[7:4]
  18. defc DOSJPTABLE = 26195 ;; Address for disk drive jump table
  19. ;;
  20. ;; Allocate a free DOSFD and DOSBUF (ERR 19 if all full)
  21. ;; On exit:
  22. ;; B = (IX+12) = DOS file no = DOSFD0 offset = DOS buf no << 4
  23. ;; C = (HL) = byte immediately after BASIC device list entry
  24. ;; A = 0, CF = 0, ZF = 1 (XOR A)
  25. ;;
  26. ;; Other registers unchanged including prime registers
  27. ;;
  28. defc DOSALLOCBUF = 26100 ;; Allocate a DOSBUF
  29. ;;
  30. ;; Initialize an IX map + DOSFD
  31. ;;
  32. ;; On entry:
  33. ;; B = DOS file no
  34. ;; On exit:
  35. ;; (IX+12) = B
  36. ;; HL = (IX+8,9) = (IX+10,11) -> DOSBUF + 3 = DOSBUF0 + 3 + (B << 4)
  37. ;; (HL) = 3
  38. ;; (IX+7) = 132
  39. ;; (IX+13) = 252
  40. ;; (IX+14) = 0
  41. ;; A = 0, CF = 0, ZF = 1 (XOR A)
  42. ;;
  43. ;; Other registers unchanged including prime registers
  44. ;;
  45. defc DOSBUFINIT = 26155 ;; Initialize an IX map+DOS file descriptor
  46. ;;
  47. ;; Same, but takes DOS file no in A rather than B, and does not write (IX+12)
  48. ;; Useful in that BC is preserved.
  49. ;;
  50. defc DOSBUFREINIT = 26159