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.

131 lines
2.0KB

  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