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.

rel1.src 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. .page 'rel1'
  2. ;***********************************
  3. ;*
  4. ;* routine: nxtrec
  5. ;*
  6. ;*
  7. ;*
  8. ;*
  9. ;*
  10. ;***********************************
  11. nxtrec
  12. lda #ovrflo
  13. jsr clrflg
  14. ;
  15. lda #lrf
  16. jsr tstflg
  17. bne nxtr40
  18. ;
  19. ldx lindx
  20. inc recl,x ; goto next record #
  21. bne nxtr15
  22. inc rech,x
  23. ;
  24. nxtr15
  25. ldx lindx
  26. lda nr,x
  27. beq nxtr45 ; there is a nr
  28. ;
  29. jsr getpnt ; get pointer
  30. ldx lindx ; test if same buffer
  31. cmp nr,x
  32. bcc nxtr20 ; yes, bt<nr
  33. ;
  34. jsr nrbuf ; no,next buffer
  35. ;
  36. nxtr20 ldx lindx
  37. lda nr,x
  38. jsr setpnt ; advance to next rec
  39. lda (buftab,x) ; read 1st dat byte
  40. ;
  41. sta data ; save for read channel
  42. lda #ovrflo
  43. jsr clrflg ; clear
  44. ; the overflow flag
  45. jsr addnr ; advance nr
  46. nxout
  47. pha
  48. bcc nxtr30 ; no block boundary
  49. ;
  50. lda #0
  51. jsr drdbyt ; check track link
  52. bne nxtr30 ; not last block
  53. ;
  54. pla
  55. cmp #2
  56. beq nxtr50
  57. nxtr45
  58. lda #lrf
  59. jsr setflg
  60. nxtr40
  61. jsr getpre
  62. lda buftab,x
  63. sta lstchr,y
  64. lda #cr
  65. sta data
  66. rts
  67. ;
  68. nxtr50
  69. jsr nxtr35
  70. ldx lindx
  71. lda #0
  72. sta nr,x
  73. rts
  74. nxtr30
  75. pla
  76. nxtr35
  77. ldx lindx
  78. ;*
  79. sta nr,x
  80. jmp setlst
  81. ;*
  82. ;*
  83. ;**********************************
  84. ;*
  85. ;*
  86. ;* nrbuf
  87. ;*
  88. ;*
  89. ;********************************
  90. ;*
  91. ;*
  92. nrbuf ; read trk,sec link
  93. jsr setdrn
  94. jsr rdlnk
  95. ;
  96. ;
  97. jsr gaflgs ; test if dirty
  98. bvc nrbu50 ; clean, dont write out
  99. ;
  100. jsr wrtout ; dirty, write out
  101. jsr dblbuf ; toggle active buffer
  102. ;
  103. lda #2
  104. jsr setpnt
  105. jsr tstwrt ; test if lstjob is wrt
  106. bne nrbu20 ; not a write,buffer ok
  107. ;
  108. jsr rdab ; read in needed buffer
  109. jmp watjob ; wait around till done
  110. ;
  111. nrbu50 jsr dblbuf ; toggle act buf
  112. jsr tstwrt ; was lstjob a wrt?
  113. bne nrbu70 ; not a write
  114. ;
  115. jsr rdab ; read in needed buffer
  116. jsr watjob ; wait till done
  117. ;
  118. nrbu70 ; read trk,sec link
  119. jsr rdlnk ; to do a read ahead
  120. ;
  121. lda track ; test if last buffer
  122. beq nrbu20 ; yes,no dbl buff todo
  123. ;
  124. jsr dblbuf ; start read job on the
  125. jsr rdab ; inactive buffer
  126. jsr dblbuf
  127. ;
  128. nrbu20 rts
  129. ;
  130. ; .end