-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestparse.asm
202 lines (190 loc) · 2.77 KB
/
testparse.asm
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
202
;;; -*- TI-Asm -*-
processor z80
nolist
include <ti83plus.inc>
list
include "defs.inc"
org userMem-2
db t2ByteTok, tasmCmp
BCALL _RunIndicOff
call OpenWorkspace
Loop:
ld hl,appBackUpScreen
ld bc,768
call GetS_Console
ret c
push hl
BCALL _RunIndicOn
BCALL _NewLine
pop hl
push hl
BCALL _StrLength
pop hl
call ParseBuffer
push hl
BCALL _RunIndicOff
pop hl
call Display
BCALL _NewLine
jr Loop
; GetS: ld hl,appBackUpScreen
; GetS_Loop:
; push hl
; BCALL _CursorOn
; res onInterrupt,(iy+onFlags)
; BCALL _GetKey
; push af
; BCALL _CursorOff
; pop af
; pop hl
; cp kLeft
; jr z,GetS_Del
; cp kDel
; jr z,GetS_Del
; cp kEnter
; jr z,GetS_Done
; cp kQuit
; scf
; ret z
; cp EchoStart
; jr c,GetS_Loop
; ld e,a
; cp 0FCh
; jr c,GetS_1B
; ld d,a
; ld a,(keyExtend)
; ld e,a
; GetS_1B:
; push hl
; BCALL _KeyToString
; inc hl
; ld a,(hl)
; pop hl
; ld (hl),a
; inc hl
; BCALL _PutC
; jr GetS_Loop
; GetS_Done:
; ld (hl),0
; ld hl,appBackUpScreen
; ret
; GetS_Del:
; ld a,(curCol)
; or a
; jr z,GetS_Del_LeftEdge
; dec a
; GetS_Del_Done:
; dec hl
; ld (curCol),a
; ld a,' '
; BCALL _PutMap
; jr GetS_Loop
; GetS_Del_LeftEdge:
; ld a,h
; cp high(appBackUpScreen)
; jr nz,GetS_Del_LeftEdge_OK
; ld a,l
; cp low(appBackUpScreen)
; jr z,GetS_Loop
; GetS_Del_LeftEdge_OK:
; ld a,(curRow)
; or a
; jr z,GetS_Del_TopLeft
; dec a
; ld (curRow),a
; GetS_Del_LeftEdge_Done:
; ld a,15
; jr GetS_Del_Done
; GetS_Del_TopLeft:
; ld (hl),0
; ld bc,-16
; add hl,bc
; BCALL _PutS
; jr GetS_Del_LeftEdge_Done
Display:
ld bc,0 ; indentation level
Display_Indented:
call IsList
jr c,Display_NotList
push af
ld a,LlBrack
BCALL _PutC
pop af
jr z,Display_ListEmpty
inc b
Display_ListLoop:
push hl
call GetListFirst
call Display_Indented
pop hl
call GetListButfirst
call IsList
jr z,Display_ListDone
call DisplayIndent
jr Display_ListLoop
Display_ListDone:
dec b
Display_ListEmpty:
ld a,LrBrack
BCALL _PutC
ret
Display_NotList:
call IsWord
jr c,Display_NotListOrWord
push bc
push hl
call GetWordSize
ld b,h
ld c,l
pop hl
ld de,0
Display_WordLoop:
ld a,b
or c
jr z,Display_WordDone
push bc
push de
push hl
call GetWordChar
BCALL _PutC
pop hl
pop de
pop bc
inc de
dec bc
jr Display_WordLoop
Display_WordDone:
pop bc
ret
Display_NotListOrWord:
ld a,'?'
BCALL _PutC
ret
DisplayIndent:
ld a,c
inc a
and 7
ld c,a
jr nz,DisplayIndent_NoPause
push bc
push hl
BCALL _RunIndicOn
ld a,busyPause
ld (indicBusy),a
BCALL _GetKey
BCALL _RunIndicOff
pop hl
pop bc
DisplayIndent_NoPause:
BCALL _NewLine
ld a,b
or a
ret z
push bc
DisplayIndentLoop:
ld a,' '
BCALL _PutC
djnz DisplayIndentLoop
pop bc
ret
include "logocore.asm"