forked from mist64/cbmsrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
code20
144 lines (144 loc) · 1.7 KB
/
code20
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
.PAG 'CODE20'
MOVFR LDA RESHO
STA FACHO
LDA RESMOH
STA FACMOH
LDA RESMO
STA FACMO
LDA RESLO
STA FACLO
JMP NORMAL
MOVFM STA INDEX1
STY INDEX1+1
LDY #3+ADDPRC
LDA (INDEX1)Y
STA FACLO
DEY
LDA (INDEX1)Y
STA FACMO
DEY
LDA (INDEX1)Y
STA FACMOH
DEY
LDA (INDEX1)Y
STA FACSGN
ORA #@200
STA FACHO
DEY
LDA (INDEX1)Y
STA FACEXP
STY FACOV
RTS
MOV2F LDX #TEMPF2
.BYT $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
FCOMPN 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