-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathieee
201 lines (201 loc) · 2.45 KB
/
ieee
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
.PAGE 'IEEE'
;
;
;
; *MAIN LOOP WHEN DEVICE IS IDLE
;
; USER CAN FEED PAPER
; PRINTER IS WAITING FOR ATN
;
; *THEN FORMATTER USES THE 'GET'
; ENTRY POINT WHEN THE IEEE
; ROUTINE WILL DETERMINE IF NUMERIC DATA
;
;
; IEEE RETURNS WITH THE OVERFLOW
; SET IF DIFFERENT SA
;
; DATA RETURNS IN .A
;
;
GET
IEEE
; TEST IF ATN LOW
BIT CIEEE
BPL ATNMOD ; IT IS ATNMODE
;
LDA FACT ; TEST IF ALREADY ADRSED
BEQ ALLWPF ; ALLOW PAPER FEED
;
JMP DATMOD ; IN DATA MODE
;
ALLWPF JSR FFTEST
JMP IEEE
;
ATNMOD LDA #0 ; CLEAR ADRS FLAGS
STA FACT
STA SA
;
;PULL DAC LOW
LDA CIEEE
ORA #NDAC
STA CIEEE
;
ATNM10
;PULL NRFD HIGH
LDA CIEEE
ORA #NRFD
STA CIEEE
;
ATNM15 BIT CIEEE ; TEST FOR ATN LOW
BMI ATNM80 ; IT'S HIGH
;
; WAIT FOR DAV LOW
BVS ATNM15
;PULL NRFD LOW
LDA CIEEE
AND #$FF-NRFD
STA CIEEE
;
LDA DIEEE ; READ AND INVERT DATA
EOR #$FF
STA DATA
;
;PULL DAC HIGH
LDA CIEEE
AND #$FF-NDAC
STA CIEEE
;
ATNM20
BIT CIEEE ; WAIT FOR DAV HI
BVC ATNM20
;
;PULL DAC LOW
LDA CIEEE
ORA #NDAC
STA CIEEE
;
LDA DATA ; DECODE COMMAND
;
CMP #UNLSN
BNE ATNM25 ; NOT UNLISTEN
;
LDA #0
STA FACT
STA SA
BEQ ATNMA
;
ATNM25 CMP DBN ; IS IT US?
BNE ATNM30
;
LDA #$FF ; SET JUST RECEIVED OUR PA
STA FACT
BNE ATNMB
;
ATNM30 AND #$60 ;TEST IF SA
CMP #$60
BNE ATNMA ; GARBAGE
;
LDA FACT ; JUST RECEIVED PA?
BPL ATNMB ; NOT ADDRESSED OR NOT FOR US
;
LDA DATA
AND #$1F
STA SA ; SAVE THE SA
;
ATNMA LDA FACT
BPL ATNMB
;
LDA #$7F
STA FACT
;
ATNMB BIT CIEEE ; TEST ATN STILL LOW
BMI ATNM80 ; ATN IS GONE
;
JMP ATNM10 ; MORE TO LISTEN TO
;
ATNM80 LDA FACT ; TEST IF ADRSED
BNE ATNM85 ; YES
;
;PULL NRFD HIGH
LDA CIEEE
ORA #NRFD
STA CIEEE
;PULL DAC HIGH
LDA CIEEE
AND #$FF-NDAC
STA CIEEE
;
DATL90 JMP IEEE
;
ATNM85 ;ACTIVE LISTEN NOW
;PULL NRFD LOW
LDA CIEEE
AND #$FF-NRFD
STA CIEEE
;PULL DAC LOW
LDA CIEEE
ORA #NDAC
STA CIEEE
;
DATMOD ; ASK FOR BYTE
;PULL NRFD HIGH
LDA CIEEE
ORA #NRFD
STA CIEEE
;
DATL10 BIT CIEEE ; TEST FOR ATN ASSERTED
BPL DATL90 ;IT IS
; WAIT FOR BYTE
BVS DATL10
;PULL NRFD LOW
LDA CIEEE
AND #$FF-NRFD
STA CIEEE
;
LDA DIEEE
EOR #$FF
STA DATA
;
;PULL DAC HIGH
LDA CIEEE
AND #$FF-NDAC
STA CIEEE
;
DATL20
BIT CIEEE ; WAIT FOR DAV HI
BVC DATL20
;
;PULL DAC LOW
LDA CIEEE
ORA #NDAC
STA CIEEE
;
;
; SET OVERFLOW IF DIFFERENT SA
;
LDA SA
CMP OLDSA
BEQ I3E50
;
STA OLDSA ; ITS A NEW ONE
LDA #$40
PHA
PLP ; SET OVERFLOW
BVS GET20
;
I3E50 CLV
;
GET20 LDA DATA ; TEST IF NUMERIC
CMP #'0
BCC GET30
;
CMP #':
RTS
;
GET30 SEC
RTS
;
;
;
.END