-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathcode15
158 lines (158 loc) · 1.8 KB
/
code15
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
.PAG 'CODE15'
STA INDEX1
STX INDEX1+1
SVAR CPX ARYTAB+1
BNE SVARGO
CMP ARYTAB
BEQ ARYVAR
SVARGO JSR DVARS
BEQ SVAR
ARYVAR STA ARYPNT
STX ARYPNT+1
LDA #STRSIZ
STA FOUR6
ARYVA2 LDA ARYPNT
LDX ARYPNT+1
ARYVA3 CPX STREND+1
BNE ARYVGO
CMP STREND
BNE *+5
JMP GRBPAS
ARYVGO STA INDEX1
STX INDEX1+1
LDY #1-ADDPRC
LDA (INDEX1)Y
TAX
INY
LDA (INDEX1)Y
PHP
INY
LDA (INDEX1)Y
ADC ARYPNT
STA ARYPNT
INY
LDA (INDEX1)Y
ADC ARYPNT+1
STA ARYPNT+1
PLP
BPL ARYVA2
TXA
BMI ARYVA2
INY
LDA (INDEX1)Y
LDY #0
ASL A
ADC #5
ADC INDEX1
STA INDEX1
BCC ARYGET
INC INDEX1+1
ARYGET LDX INDEX1+1
ARYSTR CPX ARYPNT+1
BNE GOGO
CMP ARYPNT
BEQ ARYVA3
GOGO JSR DVAR
BEQ ARYSTR
DVARS LDA (INDEX1)Y
BMI DVARTS
INY
LDA (INDEX1)Y
BPL DVARTS
INY
DVAR LDA (INDEX1)Y
BEQ DVARTS
INY
LDA (INDEX1)Y
TAX
INY
LDA (INDEX1)Y
CMP FRETOP+1
BCC DVAR2
BNE DVARTS
CPX FRETOP
BCS DVARTS
DVAR2 CMP GRBTOP+1
BCC DVARTS
BNE DVAR3
CPX GRBTOP
BCC DVARTS
DVAR3 STX GRBTOP
STA GRBTOP+1
LDA INDEX1
LDX INDEX1+1
STA GRBPNT
STX GRBPNT+1
LDA FOUR6
STA SIZE
DVARTS LDA FOUR6
CLC
ADC INDEX1
STA INDEX1
BCC GRBRTS
INC INDEX1+1
GRBRTS LDX INDEX1+1
LDY #0
RTS
GRBPAS LDA GRBPNT+1
ORA GRBPNT
BEQ GRBRTS
LDA SIZE
AND #4
LSR A
TAY
STA SIZE
LDA (GRBPNT)Y
ADC LOWTR
STA HIGHTR
LDA LOWTR+1
ADC #0
STA HIGHTR+1
LDA FRETOP
LDX FRETOP+1
STA HIGHDS
STX HIGHDS+1
JSR BLTUC
LDY SIZE
INY
LDA HIGHDS
STA (GRBPNT)Y
TAX
INC HIGHDS+1
LDA HIGHDS+1
INY
STA (GRBPNT)Y
JMP FNDVAR
CAT LDA FACLO
PHA
LDA FACMO
PHA
JSR EVAL
JSR CHKSTR
PLA
STA STRNG1
PLA
STA STRNG1+1
LDY #0
LDA (STRNG1)Y
CLC
ADC (FACMO)Y
BCC SIZEOK
LDX #ERRLS
JMP ERROR
SIZEOK JSR STRINI
JSR MOVINS
LDA DSCPNT
LDY DSCPNT+1
JSR FRETMP
JSR MOVDO
LDA STRNG1
LDY STRNG1+1
JSR FRETMP
JSR PUTNEW
JMP TSTOP
MOVINS LDY #0
LDA (STRNG1)Y
PHA
INY
.END