-
Notifications
You must be signed in to change notification settings - Fork 1
/
cio.inc
175 lines (158 loc) · 2.12 KB
/
cio.inc
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
; IOCB-Konstante
CIOV = $E456
ICCOM = $342
ICSTA = $343
ICBAL = $344
ICBAH = $345
ICBLL = $348
ICBLH = $349
ICAX1 = $34A
ICAX2 = $34B
; CIO-Befehle
COPEN = 3
CCLSE = 12
CGTXT = 5
CPTXT = 9
CGBIN = 7
CPBIN = 11
.MACRO KANNUM ;KANAL
LDX #[%1]*16
.ENDM
.MACRO OPEN ; KANAL,AUX1,AUX2,FILENAME
KANNUM %1
LDA #%2
STA ICAX1,X
LDA #%3
STA ICAX2,X
LDA #COPEN
STA ICCOM,X
LDA #<[%4]
STA ICBAL,X
LDA #>[%4]
STA ICBAH,X
JSR CIOV
.ENDM
.MACRO CLOSE ; KANAL
KANNUM %1
LDA #CCLSE
STA ICCOM,X
JSR CIOV
.ENDM
.MACRO NOTE ; KANAL,SECTOR
KANNUM %1
LDA #$26
STA ICCOM,X
JSR CIOV
LDA $34C,X
STA %2
LDA $34D,X
STA %2+1
.ENDM
.MACRO PRINT ; KANAL,LABEL
KANNUM %1
LDA #CPTXT
STA ICCOM,X
LDA #<[%2]
STA ICBAL,X
LDA #>[%2]
STA ICBAH,X
LDA #127 ; max. Laenge
STA ICBLL,X
LDA #0
STA ICBLH,X
JSR CIOV
.ENDM
.MACRO PRINT2 ; KANAL,VECTOR
KANNUM %1
LDA #CPTXT
STA ICCOM,X
LDA %2
STA ICBAL,X
LDA %2+1
STA ICBAH,X
LDA #127 ; max. Laenge
STA ICBLL,X
LDA #0
STA ICBLH,X
JSR CIOV
.ENDM
.MACRO PUT
LDX #[%1]*16
LDA #CPBIN
STA ICCOM,X
LDA #0
STA ICBLL,X
STA ICBLH,X
LDA #[%2]
JSR CIOV
.ENDM
.MACRO BPUT ; KANAL,LAENGE,BUFFER
KANNUM %1
LDA #CPBIN
STA ICCOM,X
LDA #<[%2]
STA ICBLL,X
LDA #>[%2]
STA ICBLH,X
LDA #<[%3]
STA ICBAL,X
LDA #>[%3]
STA ICBAH,X
JSR CIOV
.ENDM
.MACRO BPUT2 ; KANAL,LEN-VECTOR,BUFFER
KANNUM %1
LDA #CPBIN
STA ICCOM,X
LDA %2
STA ICBLL,X
LDA %2+1
STA ICBLH,X
LDA #<[%3]
STA ICBAL,X
LDA #>[%3]
STA ICBAH,X
JSR CIOV
.ENDM
.MACRO BPUT3 ; KANAL,LEN-VECTOR,BUFFER-VEC
KANNUM %1
LDA #CPBIN
STA ICCOM,X
LDA %2
STA ICBLL,X
LDA %2+1
STA ICBLH,X
LDA %3
STA ICBAL,X
LDA %3+1
STA ICBAH,X
JSR CIOV
.ENDM
.MACRO BGET ; KANAL,LAENGE,BUFFER
KANNUM %1
LDA #CGBIN
STA ICCOM,X
LDA #<[%2]
STA ICBLL,X
LDA #>[%2]
STA ICBLH,X
LDA #<[%3]
STA ICBAL,X
LDA #>[%3]
STA ICBAH,X
JSR CIOV
.ENDM
.MACRO INPUT ; KANAL,BUFFER
KANNUM %1
LDA #CGTXT
STA ICCOM,X
LDA #<[%2]
STA ICBAL,X
LDA #>[%2]
STA ICBAH,X
LDA #127 ; max. Laenge
STA ICBLL,X
LDA #0
STA ICBLH,X
JSR CIOV
.ENDM