You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lstdir.src 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. .page 'list directory'
  2. ; start the directory loading function
  3. ; get the buffer and get it started
  4. ;
  5. stdir lda #0
  6. sta sa
  7. lda #1 ; allocate chanl and 1 bufefer
  8. jsr getrch
  9. lda #0
  10. jsr setpnt
  11. ldx lindx
  12. lda #0
  13. sta lstchr,x
  14. jsr getact
  15. tax
  16. lda drvnum
  17. sta lstjob,x
  18. lda #1 ; put sal in buffer
  19. jsr putbyt
  20. lda #4 ; put sah in buffer
  21. jsr putbyt
  22. lda #1 ; insert fhoney links (0101)
  23. jsr putbyt
  24. jsr putbyt
  25. lda nbtemp
  26. jsr putbyt ; put in drvnum
  27. lda #0
  28. jsr putbyt
  29. jsr movbuf ; get disk name
  30. jsr getact
  31. asl a
  32. tax
  33. dec buftab,x
  34. dec buftab,x
  35. lda #0 ; end of this line
  36. jsr putbyt
  37. dir1 lda #1 ; insert fhoney links ($0101)
  38. jsr putbyt
  39. jsr putbyt
  40. jsr getnam ; get #bufrs and file name
  41. bcc dir3 ; test if last entry
  42. lda nbtemp
  43. jsr putbyt
  44. lda nbtemp+1
  45. jsr putbyt
  46. jsr movbuf
  47. lda #0 ; end of entry
  48. jsr putbyt
  49. bne dir1
  50. dir10 jsr getact
  51. asl a
  52. tax
  53. lda #0
  54. sta buftab,x
  55. lda #rdytlk
  56. ldy lindx
  57. sta dirlst
  58. sta chnrdy,y ; directory list buffer full
  59. lda data
  60. rts
  61. ;
  62. ;
  63. dir3 lda nbtemp ; this is end of load
  64. jsr putbyt
  65. lda nbtemp+1
  66. jsr putbyt
  67. jsr movbuf
  68. jsr getact
  69. asl a
  70. tax
  71. dec buftab,x
  72. dec buftab,x
  73. lda #0 ; end of listing (000)
  74. jsr putbyt
  75. jsr putbyt
  76. jsr putbyt
  77. jsr getact
  78. asl a
  79. tay
  80. lda buftab,y
  81. ldx lindx
  82. sta lstchr,x
  83. dec lstchr,x
  84. jmp dir10
  85. ;
  86. ;
  87. ;
  88. ;
  89. ; transfer file name to listing buffer
  90. ;
  91. movbuf ldy #0
  92. movb1 lda nambuf,y
  93. jsr putbyt
  94. iny
  95. cpy #27
  96. bne movb1
  97. rts
  98. ;
  99. ;
  100. ; get char for directory loading
  101. ;
  102. getdir jsr getbyt
  103. beq getd3
  104. rts
  105. getd3 sta data
  106. ldy lindx
  107. lda lstchr,y
  108. beq gd1
  109. lda #eoiout
  110. sta chnrdy,y
  111. lda data
  112. rts
  113. gd1
  114. pha
  115. jsr dir1
  116. pla
  117. rts
  118. ;
  119. ; .end