-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathcode20.src
191 lines (174 loc) · 1.81 KB
/
code20.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
189
190
191
.page
.subttl 'code20'
movfr
lda resho
sta facho
lda resmoh
sta facmoh
lda resmo
sta facmo
lda reslo
sta faclo
jmp normal
movfrm
clc ;move from ram
.byte $24
movfm
sec ;move from rom
sta index1
sty index1+1
ldy #3+addprc
jsr romram
sta faclo
dey
jsr romram
sta facmo
dey
jsr romram
sta facmoh
dey
jsr romram
sta facsgn
ora #@200
sta facho
dey
jsr romram
sta facexp
sty facov
rts
mov2f
ldx #tempf2
.byte $2c
mov1f
ldx #tempf1
ldy #0
beq movmf
movvf
ldx forpnt
ldy forpnt+1
movmf
jsr round
stx index1
sty index1+1
ldy #3+addprc
lda faclo
sta (index),y
dey
lda facmo
sta (index),y
dey
lda facmoh
sta (index),y
dey
lda facsgn
ora #@177
and facho
sta (index),y
dey
lda facexp
sta (index),y
sty facov
rts
movfa
lda argsgn
movfa1
sta facsgn
ldx #4+addprc
movfal
lda argexp-1,x
sta facexp-1,x
dex
bne movfal
stx facov
rts
movaf
jsr round
movef
ldx #5+addprc
movafl
lda facexp-1,x
sta argexp-1,x
dex
bne movafl
stx facov
movrts rts
round
lda facexp
beq movrts
asl facov
bcc movrts
incrnd
jsr incfac
bne movrts
jmp rndshf
sign
lda facexp
beq signrt
fcsign
lda facsgn
fcomps
rol a
lda #$ff
bcs signrt
lda #1
signrt rts
sgn
jsr sign
float
sta facho
lda #0
sta facho+1
ldx #@210
floats
lda facho
eor #@377
rol a
floatc
lda #0
sta faclo
sta facmo
floatb
stx facexp
sta facov
sta facsgn
jmp fadflt
abs
lsr facsgn
rts
fcomp
sta index2
sty index2+1
ldy #0
lda (index2),y
iny
tax
beq sign
lda (index2),y
eor facsgn
bmi fcsign
cpx facexp
bne fcompc
lda (index2),y
ora #@200
cmp facho
bne fcompc
iny
lda (index2),y
cmp facmoh
bne fcompc
iny
lda (index2),y
cmp facmo
bne fcompc
iny
lda #@177
cmp facov
lda (index2),y
sbc faclo
beq qintrt
fcompc
lda facsgn
bcc fcompd
eor #@377
fcompd jmp fcomps
;end