-
Notifications
You must be signed in to change notification settings - Fork 84
/
rel2.src
153 lines (153 loc) · 2.9 KB
/
rel2.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
.page 'rel2'
;**********************************
;*
;* relput
;*
;*
;**********************************
;*
;*
relput jsr sdirty ; write data to buffer
jsr getact
asl a
tax
lda data
sta (buftab,x)
;
ldy buftab,x ; inc the pointer
iny
bne relp05
ldy lindx
lda nr,y
beq relp07
;
relp06
ldy #2
relp05
tya
ldy lindx
;
cmp nr,y ; test if nr=pointer
bne relp10 ; no,set new pointer
;
relp07 lda #ovrflo ; yes,set overflow
jmp setflg
;
relp10 ; write back new pointer
inc buftab,x
;
bne relp20 ; test if =0
jsr nrbuf ; prepare nxt buffer
;
relp20 rts
;*
;*
;*
;*********************************
;*
;* wrtrel
;*
;*
;*********************************
;*
;*
wrtrel
lda #lrf+ovrflo ; check all flags
jsr tstflg
bne wr50 ; some flag is set
wr10
lda data ; ready to put data
jsr relput
wr20
lda eoiflg
beq wr40 ; eoi was sent
rts
wr30
lda #ovrflo
jsr tstflg
beq wr40 ; no rec overflow
lda #recovf
sta erword ; set error for end of print
wr40
jsr clrec ; clear rest of record
jsr rd40
lda erword
beq wr45
jmp cmderr
wr45
jmp okerr
;
;
wr50
and #lrf
bne wr60 ; last rec, add
lda eoiflg
beq wr30
wr51
rts
;
wr60
lda data
pha
jsr addrel ; add to file
pla
sta data
lda #lrf
jsr clrflg
jmp wr10
;*
;*
;*
;********************************
;*
;* clrec
;*
;*********************************
;
clrec lda #ovrflo ; put 0's into rest of record
jsr tstflg
bne clr10
;
lda #0
sta data
jsr relput
;
jmp clrec
;
clr10 rts
;
;
;*
;*
;*******************************
;*
;* sdirty
;*
;*******************************
;*
;
sdirty lda #dyfile
jsr setflg
jsr gaflgs
ora #$40
ldx lbused
sta buf0,x
rts
;
;*
;*
;*******************************
;*
;* cdirty
;*
;*******************************
;*
;
cdirty jsr gaflgs
and #$bf
ldx lbused
sta buf0,x
rts
;
;
;.end