-
Notifications
You must be signed in to change notification settings - Fork 138
/
inline.s
165 lines (161 loc) · 2.81 KB
/
inline.s
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
.segment "CODE"
.ifndef CONFIG_NO_INPUTBUFFER_ZP
L2420:
.ifdef OSI
jsr OUTDO
.endif
dex
.ifdef AIM65
bmi L2423
jsr PSLS
jmp INLIN2
LB35F:
jsr OUTDO
.else
bpl INLIN2
.endif
L2423:
.ifdef OSI
jsr OUTDO
.endif
jsr CRDO
.endif
; ----------------------------------------------------------------------------
; READ A LINE, AND STRIP OFF SIGN BITS
; ----------------------------------------------------------------------------
.ifndef KBD
INLIN:
.ifdef APPLE
ldx #$DD
INLIN1:
stx $33
jsr L2900
cpx #$EF
bcs L0C32
ldx #$EF
L0C32:
lda #$00
sta INPUTBUFFER,x
ldx #<INPUTBUFFER-1
ldy #>INPUTBUFFER-1
rts
.endif
.ifndef APPLE
ldx #$00
INLIN2:
jsr GETLN
.ifdef AIM65
cmp #$1A
bne INLINAIM
jsr DU13
jmp INLIN
INLINAIM:
.endif
.ifndef CONFIG_NO_LINE_EDITING
cmp #$07
beq L2443
.endif
cmp #$0D
beq L2453
.ifndef CONFIG_NO_LINE_EDITING
cmp #$20
.ifdef AIM65
bcc L244E
.else
bcc INLIN2
.endif
.ifdef MICROTAN
cmp #$80
.else
.ifdef AIM65
cmp #$7F
beq L2420
.endif
cmp #$7D
.endif
bcs INLIN2
cmp #$40 ; @
.ifdef AIM65
beq LB35F
.else
beq L2423
.ifdef MICROTAN
cmp #$7F ; DEL
.else
cmp #$5F ; _
.endif
beq L2420
.endif
L2443:
.ifdef MICROTAN
cpx #$4F
.else
cpx #$47
.endif
bcs L244C
.endif
sta INPUTBUFFER,x
inx
.if .def(OSI) || .def(AIM65)
.byte $2C
.else
bne INLIN2
.endif
L244C:
.ifndef CONFIG_NO_LINE_EDITING
lda #$07 ; BEL
L244E:
jsr OUTDO
bne INLIN2
.endif
L2453:
jmp L29B9
.endif
.endif
.ifndef KBD
.ifndef APPLE
GETLN:
.ifdef CONFIG_FILE
jsr CHRIN
ldy CURDVC
bne L2465
.else
jsr MONRDKEY
.endif
.ifdef OSI
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
and #$7F
.endif
.endif
.ifdef APPLE
RDKEY:
jsr LFD0C
and #$7F
.endif
.ifdef SYM1
cmp #$14
.else
cmp #$0F
.endif
bne L2465
pha
lda Z14
eor #$FF
sta Z14
pla
L2465:
rts
.endif