-
Notifications
You must be signed in to change notification settings - Fork 84
/
nulbuf
63 lines (63 loc) · 951 Bytes
/
nulbuf
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