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.

154 lines
1.8KB

  1. .PAGE 'REL2'
  2. ;**********************************
  3. ;*
  4. ;* RELPUT
  5. ;*
  6. ;*
  7. ;**********************************
  8. ;*
  9. ;*
  10. RELPUT JSR SDIRTY ;WRITE DATA TO BUFFER
  11. JSR GETACT
  12. ASL A
  13. TAX
  14. LDA DATA
  15. STA (BUFTAB,X)
  16. ;
  17. LDY BUFTAB,X ;INC THE POINTER
  18. INY
  19. BNE RELP05
  20. LDY LINDX
  21. LDA NR,Y
  22. BEQ RELP07
  23. ;
  24. RELP06
  25. LDY #2
  26. RELP05
  27. TYA
  28. LDY LINDX
  29. ;
  30. CMP NR,Y ;TEST IF NR=POINTER
  31. BNE RELP10 ;NO,SET NEW POINTER
  32. ;
  33. RELP07 LDA #OVRFLO ;YES,SET OVERFLOW
  34. JMP SETFLG
  35. ;
  36. RELP10 ;WRITE BACK NEW POINTER
  37. INC BUFTAB,X
  38. ;
  39. BNE RELP20 ;TEST IF =0
  40. JSR NRBUF ;PREPARE NXT BUFFER
  41. ;
  42. RELP20 RTS
  43. ;*
  44. ;*
  45. ;*
  46. ;*********************************
  47. ;*
  48. ;* WRTREL
  49. ;*
  50. ;*
  51. ;*********************************
  52. ;*
  53. ;*
  54. WRTREL
  55. LDA #LRF+OVRFLO ;CHECK ALL FLAGS
  56. JSR TSTFLG
  57. BNE WR50 ;SOME FLAG IS SET
  58. WR10
  59. LDA DATA ;READY TO PUT DATA
  60. JSR RELPUT
  61. WR20
  62. LDA EOIFLG
  63. BEQ WR40 ;EOI WAS SENT
  64. RTS
  65. WR30
  66. LDA #OVRFLO
  67. JSR TSTFLG
  68. BEQ WR40 ;NO REC OVERFLOW
  69. LDA #RECOVF
  70. STA ERWORD ;SET ERROR FOR END OF PRINT
  71. WR40
  72. JSR CLREC ;CLEAR REST OF RECORD
  73. JSR RD40
  74. LDA ERWORD
  75. BEQ WR45
  76. JMP CMDERR
  77. WR45
  78. JMP OKERR
  79. ;
  80. ;
  81. WR50
  82. AND #LRF
  83. BNE WR60 ;LAST REC, ADD
  84. LDA EOIFLG
  85. BEQ WR30
  86. WR51
  87. RTS
  88. ;
  89. WR60
  90. LDA DATA
  91. PHA
  92. JSR ADDREL ;ADD TO FILE
  93. PLA
  94. STA DATA
  95. LDA #LRF
  96. JSR CLRFLG
  97. JMP WR10
  98. ;*
  99. ;*
  100. ;*
  101. ;********************************
  102. ;*
  103. ;* CLREC
  104. ;*
  105. ;*********************************
  106. ;
  107. CLREC LDA #OVRFLO ;PUT 0'S INTO REST OF RECORD
  108. JSR TSTFLG
  109. BNE CLR10
  110. ;
  111. LDA #0
  112. STA DATA
  113. JSR RELPUT
  114. ;
  115. JMP CLREC
  116. ;
  117. CLR10 RTS
  118. ;
  119. ;
  120. ;*
  121. ;*
  122. ;*******************************
  123. ;*
  124. ;* SDIRTY
  125. ;*
  126. ;*******************************
  127. ;*
  128. ;
  129. SDIRTY LDA #DYFILE
  130. JSR SETFLG
  131. JSR GAFLGS
  132. ORA #$40
  133. LDX LBUSED
  134. STA BUF0,X
  135. RTS
  136. ;
  137. ;*
  138. ;*
  139. ;*******************************
  140. ;*
  141. ;* CDIRTY
  142. ;*
  143. ;*******************************
  144. ;*
  145. ;
  146. CDIRTY JSR GAFLGS
  147. AND #$BF
  148. LDX LBUSED
  149. STA BUF0,X
  150. RTS
  151. ;
  152. ;
  153. .END