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.

nulbuf.src 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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