-
Notifications
You must be signed in to change notification settings - Fork 82
/
code7.src
188 lines (170 loc) · 2.31 KB
/
code7.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
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
.page
.subttl 'code7'
xspac1
jsr outspc
bne xspac2
strout
jsr strlit
strprt
jsr frefac
tax
ldy #0
inx
strpr2
dex
beq prtrts
jsr indin1 ;lda (index),y
jsr outdo
iny
cmp #cr
bne strpr2
jsr crfin
jmp strpr2
outspc
lda channl
beq crtskp
realsp
lda #' ' ;space
.byte $2c
crtskp
lda #29 ;cbm cursor right (non-destructive skip char)
.byte $2c
outqst
lda #'?'
outdo
jsr outch ;output char in .a
and #$ff
rts
.page
get
jsr errdir
sta voicno ;use as a flag to distinguish between 'get' and 'get key'
cmp #'#' ;is it 'get#'?
beq getn ;branch if yes
cmp #keytk ;is it 'get key'?
bne gettty ;branch if not
jsr chrget ;skip over 'key' token
jmp gettty
getn
jsr chrget
jsr getbyt
lda #','
jsr synchr
stx channl
jsr coin ;chkin
zz2 =buf+1
zz3 =buf+2
gettty
ldx #<zz2
ldy #>zz3
lda #0
sta buf+1
lda #64
jsr inpco1
ldx channl
bne iorele
rts
inputn
jsr getbyt
lda #','
jsr synchr
stx channl
jsr coin ;chkin
jsr notqti
iodone
lda channl
iorele
jsr clrch
ldx #0
stx channl
rts
input
cmp #'"'
bne notqti
jsr strtxt
lda #';'
jsr synchr
jsr strprt
notqti
jsr errdir
lda #','
sta buf-1
getagn
jsr qinlin
lda channl
beq bufful
jsr readst
and #2
beq bufful
jsr iodone
jmp data
bufful
lda buf ;get anything?
bne inpcon ;yes
lda channl ;no, is this keyboard
bne getagn ;no
jsr datan
jmp addon
qinlin
lda channl
bne ginlin
jsr outqst ;print '?'...
jsr realsp ;...and a space
ginlin
jmp inlin
read
ldx datptr
ldy datptr+1
lda #$98
.byte $2c
inpcon
lda #0
inpco1
sta inpflg
stx inpptr
sty inpptr+1
inloop
jsr ptrget ;get a pointer to the variable
sta forpnt ;store it's address
sty forpnt+1
ldx #1
inlopl
lda txtptr,x
sta vartxt,x
lda inpptr,x
sta txtptr,x
dex
bpl inlopl
jsr chrgot
bne datbk1
bit inpflg ;read($98),get($40),or input($00)?
bvc qdata ;branch if read or input
lda voicno ;is this a 'get' or a 'get key'?
cmp #keytk
bne inlop1 ;branch if 'get'
inlop0
jsr cgetl ;get a key
tax ;test if zero
beq inlop0 ;it is zero, keep scanning
bne inlop2 ;got a key, go put it in var.
inlop1
jsr cgetl ;get a key if pressed, otherwise gets a zero
inlop2
sta buf
zz4 =buf-1
ldx #<zz4
ldy #>zz4
bne datbk
qdata
bpl qdata1
jmp datlop ;branch if 'read'
qdata1
lda channl
bne getnth
jsr outqst
getnth
jsr qinlin
datbk
stx txtptr
sty txtptr+1
;end