-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathcode25
212 lines (212 loc) · 2.81 KB
/
code25
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
203
204
205
206
207
208
209
210
211
212
;CODE25
STOLD STA OLDOV
JSR MOVEF
LDA FACEXP
CMP #@210
BCC EXP1
GOMLDV JSR MLDVEX
EXP1 JSR INT
LDA INTEGR
CLC
ADC #@201
BEQ GOMLDV
SEC
SBC #1
PHA
LDX #4+ADDPRC
SWAPLP LDA ARGEXP,X
LDY FACEXP,X
STA FACEXP,X
STY ARGEXP,X
DEX
BPL SWAPLP
LDA OLDOV
STA FACOV
JSR FSUBT
JSR NEGOP
LDA #<EXPCON
LDY #>EXPCON
JSR POLY
LDA #0
STA ARISGN
PLA
JSR MLDEXP
RTS
POLYX STA POLYPT
STY POLYPT+1
JSR MOV1F
LDA #TEMPF1
JSR FMULT
JSR POLY1
LDA #<TEMPF1
LDY #>TEMPF1
JMP FMULT
POLY STA POLYPT
STY POLYPT+1
POLY1 JSR MOV2F
LDA (POLYPT)Y
STA DEGREE
LDY POLYPT
INY
TYA
BNE POLY3
INC POLYPT+1
POLY3 STA POLYPT
LDY POLYPT+1
POLY2 JSR FMULT
LDA POLYPT
LDY POLYPT+1
CLC
ADC #4+ADDPRC
BCC POLY4
INY
POLY4 STA POLYPT
STY POLYPT+1
JSR FADD
LDA #<TEMPF2
LDY #>TEMPF2
DEC DEGREE
BNE POLY2
RTS
RMULC .BYT @230,@65,@104,@172
RADDC .BYT @150,@50,@261,@106
RND JSR SIGN
BMI RND1
BNE QSETNR
LDA CHTIM
STA FACHO
LDA CHTIM+4
STA FACMOH
LDA CHTIM+1
STA FACMO
LDA CHTIM+5
STA FACLO
JMP STRNEX
QSETNR LDA #<RNDX
LDY #>RNDX
JSR MOVFM
LDA #<RMULC
LDY #>RMULC
JSR FMULT
LDA #<RADDC
LDY #>RADDC
JSR FADD
RND1 LDX FACLO
LDA FACHO
STA FACLO
STX FACHO
LDX FACMOH
LDA FACMO
STA FACMOH
STX FACMO
STRNEX LDA #0
STA FACSGN
LDA FACEXP
STA FACOV
LDA #@200
STA FACEXP
JSR NORMAL
LDX #<RNDX
LDY #>RNDX
GMOVMF JMP MOVMF
COS LDA #<PI2
LDY #>PI2
JSR FADD
SIN JSR MOVAF
LDA #<TWOPI
LDY #>TWOPI
LDX ARGSGN
JSR FDIVF
JSR MOVAF
JSR INT
LDA #0
STA ARISGN
JSR FSUBT
LDA #<FR4
LDY #>FR4
JSR FSUB
LDA FACSGN
PHA
BPL SIN1
JSR FADDH
LDA FACSGN
BMI SIN2
LDA TANSGN
EOR #$FF
STA TANSGN
SIN1 JSR NEGOP
SIN2 LDA #<FR4
LDY #>FR4
JSR FADD
PLA
BPL SIN3
JSR NEGOP
SIN3 LDA #<SINCON
LDY #>SINCON
JMP POLYX
TAN JSR MOV1F
LDA #0
STA TANSGN
JSR SIN
LDX #<TEMPF3
LDY #>TEMPF3
JSR GMOVMF
LDA #<TEMPF1
LDY #>TEMPF1
JSR MOVFM
LDA #0
STA FACSGN
LDA TANSGN
JSR COSC
LDA #<TEMPF3
LDY #>TEMPF3
JMP FDIV
COSC PHA
JMP SIN1
PI2 .BYT @201,@111,@17,@332,@242
TWOPI .BYT @203,@111,@17,@332,@242
FR4 .BYT @177,0,0,0,0
SINCON .BYT 5,@204,@346,@32,@55
.BYT @33,@206,@50,@7,@373
.BYT @370,@207,@231,@150,@211
.BYT 1,@207,@43,@65,@337,@341
.BYT @206,@245,@135,@347,@50,@203
.BYT @111,@17,@332,@242
ATN LDA FACSGN
PHA
BPL ATN1
JSR NEGOP
ATN1 LDA FACEXP
PHA
CMP #@201
BCC ATN2
LDA #<FONE
LDY #>FONE
JSR FDIV
ATN2 LDA #<ATNCON
LDY #>ATNCON
JSR POLYX
PLA
CMP #@201
BCC ATN3
LDA #<PI2
LDY #>PI2
JSR FSUB
ATN3 PLA
BPL ATN4
JMP NEGOP
ATN4 RTS
ATNCON .BYT @13,@166,@263,@203
.BYT @275,@323,@171,@36,@364
.BYT @246,@365,@173,@203,@374
.BYT @260,@20
.BYT @174,@14,@37,@147,@312
.BYT @174,@336,@123,@313,@301
.BYT @175,@24,@144,@160,@114
.BYT @175,@267,@352,@121,@172
.BYT @175,@143,@60,@210,@176
.BYT @176,@222,@104,@231,@72
.BYT @176,@114,@314,@221,@307
.BYT @177,@252,@252,@252,@23
.BYT @201,0,0,0,0
.FIL CODE26