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.

64 lines
951B

  1. .PAGE 'NULBUF'
  2. ;*********************************
  3. ;* NULBUF: SET NULL RECORDS IN *
  4. ;* ACT-BUF FOR EXTENTION *
  5. ;* VARS: NR,RS,LX,ACT-BUF *
  6. ;* IN: NR= LAST RECORD *
  7. ;* POSITION IN PREVIOUS *
  8. ;* BUFFER. *
  9. ;* OUT: NR= LAST RECORD *
  10. ;* POSITION IN BUFFER *
  11. ;* FOR NEXT NULBUF OR *
  12. ;* TO SET LSTCHR. *
  13. ;*********************************
  14. ;
  15. NULBUF
  16. JSR SET00 ;SET INDIRECT PTR
  17. LDY #2
  18. LDA #0
  19. NB10
  20. STA (DIRBUF),Y ;CLEAR BUFFER
  21. INY
  22. BNE NB10
  23. ;
  24. JSR ADDNR ;ADVANCE NR
  25. NB20
  26. STA NR,X
  27. TAY
  28. LDA #$FF
  29. STA (DIRBUF),Y ;INIT RECORD W/ CR
  30. JSR ADDNR
  31. BCC NB20 ;NOT DONE
  32. ;
  33. BNE NB30
  34. LDA #0
  35. STA NR,X
  36. NB30
  37. RTS
  38. ;
  39. ; ADD RS & NR, LEAVE IN ACCUM
  40. ; C=1: CROSS BUFFER BOUNDARY
  41. ;
  42. ADDNR
  43. LDX LINDX
  44. LDA NR,X
  45. SEC
  46. BEQ AN05
  47. ;
  48. CLC
  49. ADC RS,X
  50. BCC AN10
  51. BNE AN05
  52. LDA #2
  53. BIT ER00
  54. RTS
  55. ;
  56. AN05
  57. ADC #1 ;ADJUST FOR LINK
  58. SEC
  59. AN10
  60. RTS
  61. ;
  62. ;
  63. .END