-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathcode21
144 lines (144 loc) · 1.62 KB
/
code21
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 'CODE21'
QINT LDA FACEXP
BEQ CLRFAC
SEC
SBC #ADDPR8+@230
BIT FACSGN
BPL QISHFT
TAX
LDA #@377
STA BITS
JSR NEGFCH
TXA
QISHFT LDX #FAC
CMP #$F9
BPL QINT1
JSR SHIFTR
STY BITS
QINTRT RTS
QINT1 TAY
LDA FACSGN
AND #@200
LSR FACHO
ORA FACHO
STA FACHO
JSR ROLSHF
STY BITS
RTS
INT LDA FACEXP
CMP #ADDPR8+@230
BCS INTRTS
JSR QINT
STY FACOV
LDA FACSGN
STY FACSGN
EOR #@200
ROL A
LDA #@230+8
STA FACEXP
LDA FACLO
STA INTEGR
JMP FADFLT
CLRFAC STA FACHO
STA FACMOH
STA FACMO
STA FACLO
TAY
INTRTS RTS
FIN LDY #@0
LDX #@11+ADDPRC
FINZLP STY DECCNT,X
DEX
BPL FINZLP
BCC FINDGQ
CMP #'-
BNE QPLUS
STX SGNFLG
BEQ FINC
QPLUS CMP #'+
BNE FIN1
FINC JSR CHRGET
FINDGQ BCC FINDIG
FIN1 CMP #'.
BEQ FINDP
CMP #'E
BNE FINE
JSR CHRGET
BCC FNEDG1
CMP #MINUTK
BEQ FINEC1
CMP #'-
BEQ FINEC1
CMP #PLUSTK
BEQ FINEC
CMP #'+
BEQ FINEC
BNE FINEC2
FINEC1 ROR EXPSGN
FINEC JSR CHRGET
FNEDG1 BCC FINEDG
FINEC2 BIT EXPSGN
BPL FINE
LDA #0
SEC
SBC TENEXP
JMP FINE1
FINDP ROR DPTFLG
BIT DPTFLG
BVC FINC
FINE LDA TENEXP
FINE1 SEC
SBC DECCNT
STA TENEXP
BEQ FINQNG
BPL FINMUL
FINDIV JSR DIV10
INC TENEXP
BNE FINDIV
BEQ FINQNG
FINMUL JSR MUL10
DEC TENEXP
BNE FINMUL
FINQNG LDA SGNFLG
BMI NEGXQS
RTS
NEGXQS JMP NEGOP
FINDIG PHA
BIT DPTFLG
BPL FINDG1
INC DECCNT
FINDG1 JSR MUL10
PLA
SEC
SBC #'0
JSR FINLOG
JMP FINC
FINLOG PHA
JSR MOVAF
PLA
JSR FLOAT
LDA ARGSGN
EOR FACSGN
STA ARISGN
LDX FACEXP
JMP FADDT
FINEDG LDA TENEXP
CMP #@12
BCC MLEX10
LDA #@144
BIT EXPSGN
BMI MLEXMI
JMP OVERR
MLEX10 ASL A
ASL A
CLC
ADC TENEXP
ASL A
CLC
LDY #0
ADC (TXTPTR)Y
SEC
SBC #'0
MLEXMI STA TENEXP
JMP FINEC
.END