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.

rel2.src 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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