-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsource_3.dat
257 lines (257 loc) · 15.8 KB
/
source_3.dat
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
[[2, '\t.stk 1024'], ['', '.stk', '1024']]
[[3, '\t.cod 512'], ['', '.cod', '512']]
[[4, 'STATIC_LINK .equ +5'], ['STATIC_LINK', '.equ', '+5']]
[[5, 'RETURN_VALUE .equ -3'], ['RETURN_VALUE', '.equ', '-3']]
[[6, 'HIGH_RETURN_VALUE .equ -1'], ['HIGH_RETURN_VALUE', '.equ', '-1']]
[[7, '_start'], ['_start']]
[[8, '\ttsx.w\t\t; Preserve original stack pointer'], ['', 'tsx.w']]
[[9, '\tlds.w #_stk_top\t; Initialize program stack pointer'], ['', 'lds.w', '#_stk_top']]
[[10, '\tstz _bss_start'], ['', 'stz', '_bss_start']]
[[11, '\tldx.w #_bss_start'], ['', 'ldx.w', '#_bss_start']]
[[12, '\tldy.w #_bss_start+1'], ['', 'ldy.w', '#_bss_start+1']]
[[13, '\tlda.w #_stk_top'], ['', 'lda.w', '#_stk_top']]
[[14, '\tsec'], ['', 'sec']]
[[15, '\tsbc.w #_bss_start'], ['', 'sbc.w', '#_bss_start']]
[[16, '\tmov #10'], ['', 'mov', '#10']]
[[17, '\tjmp _pc65_main'], ['', 'jmp', '_pc65_main']]
[[27, '_pc65_main .sub'], ['_pc65_main', '.sub']]
[[28, '\tphx.w'], ['', 'phx.w']]
[[29, '\ttsx.w'], ['', 'tsx.w']]
[[31, '\tlda #1'], ['', 'lda', '#1']]
[[32, '\tsta.w fn1_002'], ['', 'sta.w', 'fn1_002']]
[[34, '\tstz.w fn2_003'], ['', 'stz.w', 'fn2_003']]
[[38, '\tlda #2'], ['', 'lda', '#2']]
[[39, '\tsta.w i_005'], ['', 'sta.w', 'i_005']]
[[40, 'L_006'], ['L_006']]
[[41, '\tlda #24'], ['', 'lda', '#24']]
[[42, '\tcmp.w i_005'], ['', 'cmp.w', 'i_005']]
[[43, '\tbge L_007'], ['', 'bge', 'L_007']]
[[44, '\tjmp L_008'], ['', 'jmp', 'L_008']]
[[45, 'L_007'], ['L_007']]
[[47, '\tlda.w fn1_002'], ['', 'lda.w', 'fn1_002']]
[[48, '\tpha.w'], ['', 'pha.w']]
[[49, '\tlda.w fn2_003'], ['', 'lda.w', 'fn2_003']]
[[50, '\tclc'], ['', 'clc']]
[[51, '\tadc.w 1,S'], ['', 'adc.w', '1,S']]
[[52, '\tadj #2'], ['', 'adj', '#2']]
[[53, '\tsta.w tmp_004'], ['', 'sta.w', 'tmp_004']]
[[55, '\tlda.w fn1_002'], ['', 'lda.w', 'fn1_002']]
[[56, '\tsta.w fn2_003'], ['', 'sta.w', 'fn2_003']]
[[58, '\tlda.w tmp_004'], ['', 'lda.w', 'tmp_004']]
[[59, '\tsta.w fn1_002'], ['', 'sta.w', 'fn1_002']]
[[61, '\tinc.w i_005'], ['', 'inc.w', 'i_005']]
[[62, '\tjmp L_006'], ['', 'jmp', 'L_006']]
[[63, 'L_008'], ['L_008']]
[[64, '\tdec.w i_005'], ['', 'dec.w', 'i_005']]
[[66, '\tpsh.w #S_009'], ['', 'psh.w', '#S_009']]
[[67, '\tpsh.w #0'], ['', 'psh.w', '#0']]
[[68, '\tpsh.w #4'], ['', 'psh.w', '#4']]
[[69, '\tjsr _swrite'], ['', 'jsr', '_swrite']]
[[70, '\tadj #6'], ['', 'adj', '#6']]
[[72, '\tlda.w i_005'], ['', 'lda.w', 'i_005']]
[[73, '\tpha.w'], ['', 'pha.w']]
[[74, '\tpsh.w #2'], ['', 'psh.w', '#2']]
[[76, '\tjsr _iwrite'], ['', 'jsr', '_iwrite']]
[[77, '\tadj #4'], ['', 'adj', '#4']]
[[79, '\tpsh.w #S_010'], ['', 'psh.w', '#S_010']]
[[80, '\tpsh.w #0'], ['', 'psh.w', '#0']]
[[81, '\tpsh.w #4'], ['', 'psh.w', '#4']]
[[82, '\tjsr _swrite'], ['', 'jsr', '_swrite']]
[[83, '\tadj #6'], ['', 'adj', '#6']]
[[85, '\tlda.w fn1_002'], ['', 'lda.w', 'fn1_002']]
[[86, '\tpha.w'], ['', 'pha.w']]
[[87, '\tpsh.w #5'], ['', 'psh.w', '#5']]
[[89, '\tjsr _iwrite'], ['', 'jsr', '_iwrite']]
[[90, '\tadj #4'], ['', 'adj', '#4']]
[[92, '\tjsr _writeln'], ['', 'jsr', '_writeln']]
[[94, '\tplx.w'], ['', 'plx.w']]
[[95, '\trts'], ['', 'rts']]
[[96, '\t.end _pc65_main'], ['', '.end', '_pc65_main']]
[[101, ' .cod'], ['', '.cod']]
[[103, '_Q .equ 5'], ['_Q', '.equ', '5']]
[[104, '_D .equ 3'], ['_D', '.equ', '3']]
[[106, '_idiv .proc'], ['_idiv', '.proc']]
[[107, ' lda #0 ; clear remainder (A)'], ['', 'lda', '#0']]
[[108, ' dup a ; push'], ['', 'dup', 'a']]
[[109, ' lda.w _Q,S ; load dividend (Q)'], ['', 'lda.w', '_Q,S']]
[[110, ' ldy #16 ; bit counter'], ['', 'ldy', '#16']]
[[112, '_idiv_Lp'], ['_idiv_Lp']]
[[113, ' clc'], ['', 'clc']]
[[114, ' asl.w a ; shift AQ left'], ['', 'asl.w', 'a']]
[[115, ' swp a'], ['', 'swp', 'a']]
[[116, ' rol.w a'], ['', 'rol.w', 'a']]
[[118, ' bcs _idiv_Plus ; if A < 0 then A = A + D else A = A - D'], ['', 'bcs', '_idiv_Plus']]
[[120, '_idiv_Minus'], ['_idiv_Minus']]
[[121, ' sec'], ['', 'sec']]
[[122, ' sbc.w _D,S ; subtract divisor (D)'], ['', 'sbc.w', '_D,S']]
[[124, ' bra _idiv_Next'], ['', 'bra', '_idiv_Next']]
[[126, '_idiv_Plus'], ['_idiv_Plus']]
[[127, ' clc'], ['', 'clc']]
[[128, ' adc.w _D,S ; add divisor (D)'], ['', 'adc.w', '_D,S']]
[[130, '_idiv_Next'], ['_idiv_Next']]
[[131, ' swp a ; restore order of Acc stack {Q, A, -}'], ['', 'swp', 'a']]
[[132, ' bmi _idiv_Dec ; if A < 0 then Q[0] = 0 else Q[0] = 1'], ['', 'bmi', '_idiv_Dec']]
[[133, ' inc.w a'], ['', 'inc.w', 'a']]
[[135, '_idiv_Dec'], ['_idiv_Dec']]
[[136, ' dey ; loop until loop counter == 0'], ['', 'dey']]
[[137, ' bne _idiv_Lp'], ['', 'bne', '_idiv_Lp']]
[[139, '_idiv_Exit'], ['_idiv_Exit']]
[[140, ' swp a ; Test remainder'], ['', 'swp', 'a']]
[[141, ' ora.w #0'], ['', 'ora.w', '#0']]
[[142, ' bpl _idiv_Finish'], ['', 'bpl', '_idiv_Finish']]
[[143, ' clc'], ['', 'clc']]
[[144, ' adc.w 3,S'], ['', 'adc.w', '3,S']]
[[145, '_idiv_Finish'], ['_idiv_Finish']]
[[146, ' swp a'], ['', 'swp', 'a']]
[[148, ' rts'], ['', 'rts']]
[[150, ' .endp _idiv'], ['', '.endp', '_idiv']]
[[155, ' .cod'], ['', '.cod']]
[[157, '_M .equ 5'], ['_M', '.equ', '5']]
[[158, '_R .equ 3'], ['_R', '.equ', '3']]
[[160, '_imul .proc'], ['_imul', '.proc']]
[[161, ' ldy #16 ; y = bit count'], ['', 'ldy', '#16']]
[[162, ' lda #0 ; A = { 0, x, x} - clear product'], ['', 'lda', '#0']]
[[163, ' dup a ; A = { 0, 0, x}'], ['', 'dup', 'a']]
[[164, ' dup a ; A = { 0, 0, 0}'], ['', 'dup', 'a']]
[[165, ' lda.w _R,S ; A = { R, 0, 0} - load multiplier (R)'], ['', 'lda.w', '_R,S']]
[[166, ' rev ; A = {`R, 0, 0} - reverse multiplier (`R)'], ['', 'rev']]
[[167, ' ora.w #0 ; set N flag if msb ATOS == 1'], ['', 'ora.w', '#0']]
[[168, ' clc ; initialize Booth recoding bit'], ['', 'clc']]
[[169, ' rot a ; A = {PH, PL, `R}'], ['', 'rot', 'a']]
[[171, ' bra _imul_TstB'], ['', 'bra', '_imul_TstB']]
[[173, '_imul_Lp'], ['_imul_Lp']]
[[174, ' asl.w a ; A = {`R << 1, PH, PL}'], ['', 'asl.w', 'a']]
[[175, ' rot a ; A = {PH, PL, `R}'], ['', 'rot', 'a']]
[[176, '_imul_TstB'], ['_imul_TstB']]
[[177, ' bcc _imul_SubShft ; (C, x) ? Add_Shift : Sub_Shift'], ['', 'bcc', '_imul_SubShft']]
[[179, '_imul_AddShft'], ['_imul_AddShft']]
[[180, ' bmi _imul_ShftP ; (1, N) ? P >> 1 : (P += M) >> 1'], ['', 'bmi', '_imul_ShftP']]
[[181, '_imul_AddM'], ['_imul_AddM']]
[[182, ' clc'], ['', 'clc']]
[[183, ' adc.w _M,S ; PH += M'], ['', 'adc.w', '_M,S']]
[[184, ' bra _imul_ShftP'], ['', 'bra', '_imul_ShftP']]
[[186, '_imul_SubShft'], ['_imul_SubShft']]
[[187, ' bpl _imul_ShftP ; (0, N) ? (P -= M) >> 1 : P >> 1'], ['', 'bpl', '_imul_ShftP']]
[[188, '_imul_SubM'], ['_imul_SubM']]
[[189, ' sec'], ['', 'sec']]
[[190, ' sbc.w _M,S ; PH -= M'], ['', 'sbc.w', '_M,S']]
[[192, '_imul_ShftP'], ['_imul_ShftP']]
[[193, ' asr.w a ; A = {PH >> 1, PL, `R}'], ['', 'asr.w', 'a']]
[[194, ' rot a ; A = {PL, `R, PH}'], ['', 'rot', 'a']]
[[195, ' ror.w a ; A = {PL >> 2, `R, PH}'], ['', 'ror.w', 'a']]
[[196, ' rot a ; A = {`R, PH, PL}'], ['', 'rot', 'a']]
[[198, '_imul_Dec'], ['_imul_Dec']]
[[199, ' dey'], ['', 'dey']]
[[200, ' bne _imul_Lp'], ['', 'bne', '_imul_Lp']]
[[202, '_imul_Exit'], ['_imul_Exit']]
[[203, ' rot a ; A = {PH, PL, `R}'], ['', 'rot', 'a']]
[[204, ' swp a ; A = {PL, PH, `R}'], ['', 'swp', 'a']]
[[206, ' rts'], ['', 'rts']]
[[208, ' .endp _imul'], ['', '.endp', '_imul']]
[[213, ' .cod'], ['', '.cod']]
[[215, '_newLine .equ 0x0A'], ['_newLine', '.equ', '0x0A']]
[[216, '_putChar .equ 0xF001'], ['_putChar', '.equ', '0xF001']]
[[218, '_writeln .proc'], ['_writeln', '.proc']]
[[219, ' lda #_newLine'], ['', 'lda', '#_newLine']]
[[220, ' sta _putChar'], ['', 'sta', '_putChar']]
[[222, ' rts'], ['', 'rts']]
[[224, ' .endp _writeln'], ['', '.endp', '_writeln']]
[[228, ' .cod'], ['', '.cod']]
[[230, '_sPtrOff .equ 7'], ['_sPtrOff', '.equ', '7']]
[[231, '_sLenOff .equ 3'], ['_sLenOff', '.equ', '3']]
[[233, '_swrite .proc'], ['_swrite', '.proc']]
[[234, ' ldy.w _sLenOff,S ; load string length'], ['', 'ldy.w', '_sLenOff,S']]
[[235, ' lda.w _sPtrOff,S ; load string pointer'], ['', 'lda.w', '_sPtrOff,S']]
[[236, ' tai ; transfer sptr to IP'], ['', 'tai']]
[[238, '_swrite_Lp'], ['_swrite_Lp']]
[[239, ' lda 0,I++ ; load char from strig'], ['', 'lda', '0,I++']]
[[240, ' sta _putChar ; write char to output'], ['', 'sta', '_putChar']]
[[242, ' dey.w ; loop while string length <> 0'], ['', 'dey.w']]
[[243, ' bne _swrite_Lp'], ['', 'bne', '_swrite_Lp']]
[[245, ' rts'], ['', 'rts']]
[[247, ' .endp _swrite'], ['', '.endp', '_swrite']]
[[251, ' .cod'], ['', '.cod']]
[[253, '_iValOff .equ 7'], ['_iValOff', '.equ', '7']]
[[254, '_fLenOff .equ 5'], ['_fLenOff', '.equ', '5']]
[[255, '_iCntOff .equ -1'], ['_iCntOff', '.equ', '-1']]
[[257, '_iwrite .proc'], ['_iwrite', '.proc']]
[[258, ' phx.w ; save current base pointer'], ['', 'phx.w']]
[[259, ' tsx.w ; assign new base pointer'], ['', 'tsx.w']]
[[261, ' lda _fLenOff,X ; load field width specifier'], ['', 'lda', '_fLenOff,X']]
[[262, ' cmp #5 ; compare against max integer digit count'], ['', 'cmp', '#5']]
[[263, ' ble _iwrite_SetCnt'], ['', 'ble', '_iwrite_SetCnt']]
[[264, ' lda #5'], ['', 'lda', '#5']]
[[266, '_iwrite_SetCnt'], ['_iwrite_SetCnt']]
[[267, ' pha.w ; set iteration count to fld width'], ['', 'pha.w']]
[[268, ' lda.w _iValOff,X ; load a with integer value'], ['', 'lda.w', '_iValOff,X']]
[[270, '_iwrite_Lp'], ['_iwrite_Lp']]
[[271, ' pha.w ; push dividend argument to _idiv'], ['', 'pha.w']]
[[272, ' psh.w #10 ; push divisor argument to _idiv'], ['', 'psh.w', '#10']]
[[273, ' csr _idiv ; determine the remainder,'], ['', 'csr', '_idiv']]
[[274, ' adj #4 ; remove arguments passed to _idiv from stk'], ['', 'adj', '#4']]
[[275, ' swp a ; put the remainder into ATOS'], ['', 'swp', 'a']]
[[277, ' clc ; convert remainder into ASCII character'], ['', 'clc']]
[[278, ' adc #48'], ['', 'adc', '#48']]
[[279, ' pha ; push LS digit of integer onto stack'], ['', 'pha']]
[[281, ' rot a ; rotate quotient into ATOS position'], ['', 'rot', 'a']]
[[283, ' dec.w _iCntOff,X ; decrement digit iteration count'], ['', 'dec.w', '_iCntOff,X']]
[[284, ' bne _iwrite_Lp'], ['', 'bne', '_iwrite_Lp']]
[[286, ' dup a ; save integer part of the conversion'], ['', 'dup', 'a']]
[[288, '_iwrite_Fill'], ['_iwrite_Fill']]
[[289, ' lda _fLenOff,X ; load field width specifier'], ['', 'lda', '_fLenOff,X']]
[[290, ' cmp #5 ; compare against max integer digit count'], ['', 'cmp', '#5']]
[[291, ' ble _iwrite_GenPtr'], ['', 'ble', '_iwrite_GenPtr']]
[[292, ' sec ; subtract max integer length from fld len'], ['', 'sec']]
[[293, ' sbc #5'], ['', 'sbc', '#5']]
[[294, ' tay ; set difference as loop counter'], ['', 'tay']]
[[295, " lda #48 ; fill remaining field with '0'"], ['', 'lda', '#48']]
[[297, '_iwrite_Fill_Lp ; increase string on stack with fill data'], ['_iwrite_Fill_Lp']]
[[298, ' pha'], ['', 'pha']]
[[299, ' dey'], ['', 'dey']]
[[300, ' bne _iwrite_Fill_Lp'], ['', 'bne', '_iwrite_Fill_Lp']]
[[302, '_iwrite_GenPtr'], ['_iwrite_GenPtr']]
[[303, ' tsa.w ; transfer current stk pointer to A'], ['', 'tsa.w']]
[[304, ' inc.w a ; remove stack pointer write bias'], ['', 'inc.w', 'a']]
[[305, ' pha.w ; push string pointer to stack'], ['', 'pha.w']]
[[307, ' rot a ; restore integer part of the conversion'], ['', 'rot', 'a']]
[[309, ' cmp.w #0 ; test for 0. If not 0, int > 10^fld'], ['', 'cmp.w', '#0']]
[[310, ' beq _iwrite_Sup0'], ['', 'beq', '_iwrite_Sup0']]
[[311, ' ldy #0'], ['', 'ldy', '#0']]
[[312, '_iwrite_ErrLp'], ['_iwrite_ErrLp']]
[[313, " lda #0x2A ; fill integer field with '*'"], ['', 'lda', '#0x2A']]
[[314, ' sta (1,S),Y'], ['', 'sta', '(1,S),Y']]
[[315, ' iny'], ['', 'iny']]
[[316, ' cmp.y _fLenOff,X'], ['', 'cmp.y', '_fLenOff,X']]
[[317, ' bne _iwrite_ErrLp'], ['', 'bne', '_iwrite_ErrLp']]
[[318, ' bra _iwrite_Exit'], ['', 'bra', '_iwrite_Exit']]
[[320, '_iwrite_Sup0'], ['_iwrite_Sup0']]
[[321, ' ldy #0 ; initialize string index'], ['', 'ldy', '#0']]
[[322, '_iwrite_Sup0_Lp'], ['_iwrite_Sup0_Lp']]
[[323, ' lda (1,S),Y'], ['', 'lda', '(1,S),Y']]
[[324, " cmp #48 ; if leading position == 0, replace with ' '"], ['', 'cmp', '#48']]
[[325, ' bne _iwrite_Exit ; exit loop on first non-0 digit'], ['', 'bne', '_iwrite_Exit']]
[[326, " lda #32 ; replace leading 0 with ' '"], ['', 'lda', '#32']]
[[327, ' sta (1,S),Y'], ['', 'sta', '(1,S),Y']]
[[328, ' iny ; increment string index and compare to fLen'], ['', 'iny']]
[[329, ' cmp.y _fLenOff,X'], ['', 'cmp.y', '_fLenOff,X']]
[[330, ' bne _iwrite_Sup0_Lp ; loop until Y == fLen'], ['', 'bne', '_iwrite_Sup0_Lp']]
[[332, '_iwrite_Exit'], ['_iwrite_Exit']]
[[333, ' psh.w #0 ; NULL argument'], ['', 'psh.w', '#0']]
[[334, ' lda _fLenOff,X ; push field width specifier'], ['', 'lda', '_fLenOff,X']]
[[335, ' pha.w'], ['', 'pha.w']]
[[336, ' csr _swrite ; write integer value string using _swrite()'], ['', 'csr', '_swrite']]
[[337, ' adj #6 ; remove parameters to _swrite() from stack'], ['', 'adj', '#6']]
[[339, ' txs.w ; deallocate stack variables'], ['', 'txs.w']]
[[340, ' plx.w ; restore previous base pointer'], ['', 'plx.w']]
[[341, ' rts'], ['', 'rts']]
[[343, ' .endp _iwrite'], ['', '.endp', '_iwrite']]
[[345, '\t.dat'], ['', '.dat']]
[[347, 'S_010 .str "] = "'], ['S_010', '.str', '', '"] = "', '']]
[[348, 'S_009 .str "Fib["'], ['S_009', '.str', '', '"Fib["', '']]
[[349, '_bss_start .byt 0'], ['_bss_start', '.byt', '0']]
[[350, 'fn1_002 .wrd 0'], ['fn1_002', '.wrd', '0']]
[[351, 'fn2_003 .wrd 0'], ['fn2_003', '.wrd', '0']]
[[352, 'tmp_004 .wrd 0'], ['tmp_004', '.wrd', '0']]
[[353, 'i_005 .wrd 0'], ['i_005', '.wrd', '0']]
[[354, '_bss_end .byt 0'], ['_bss_end', '.byt', '0']]
[[355, '_stk .byt 0[1023]'], ['_stk', '.byt', '0[1023]']]