forked from mist64/cbmsrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nulbuf.src
63 lines (63 loc) · 1.48 KB
/
nulbuf.src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
.page 'nulbuf'
;*********************************
;* nulbuf: set null records in *
;* act-buf for extention *
;* vars: nr,rs,lx,act-buf *
;* in: nr= last record *
;* position in previous *
;* buffer. *
;* out: nr= last record *
;* position in buffer *
;* for next nulbuf or *
;* to set lstchr. *
;*********************************
;
nulbuf
jsr set00 ; set indirect ptr
ldy #2
lda #0
nb10
sta (dirbuf),y ; clear buffer
iny
bne nb10
;
jsr addnr ; advance nr
nb20
sta nr,x
tay
lda #$ff
sta (dirbuf),y ; init record w/ cr
jsr addnr
bcc nb20 ; not done
;
bne nb30
lda #0
sta nr,x
nb30
rts
;
; add rs & nr, leave in accum
; c=1: cross buffer boundary
;
addnr
ldx lindx
lda nr,x
sec
beq an05
;
clc
adc rs,x
bcc an10
bne an05
lda #2
bit er00
rts
;
an05
adc #1 ; adjust for link
sec
an10
rts
;
;
; .end