-
Notifications
You must be signed in to change notification settings - Fork 82
/
rel2
151 lines (151 loc) · 1.89 KB
/
rel2
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
;**********************************
;*
;* 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 ;GIVE ERROR
WR45
JMP OKERR ;CLEAR ERROR CHNL
;
;
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 JSR GAFLGS
ORA #$40
LDX LBUSED
STA BUF0,X
LDA #FDIRTY ;SET FILE WRITTEN TO
JMP SETFLG ;AND EXIT
;
;*
;*
;*******************************
;*
;* CDIRTY
;*
;*******************************
;*
;
CDIRTY JSR GAFLGS
AND #$BF
LDX LBUSED
STA BUF0,X
RTS
;
;
.END