-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathcode2.src
134 lines (119 loc) · 1.46 KB
/
code2.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
.page
.subttl 'code2'
fndlin
lda txttab
ldx txttab+1
fndlnc
ldy #1
sta lowtr
stx lowtr+1
jsr indlow
beq flinrt
iny
iny
jsr indlow
sta syntmp
lda linnum+1
cmp syntmp
bcc flnrts
beq fndlo1
dey
bne affrts
fndlo1
dey
jsr indlow
sta syntmp
lda linnum
cmp syntmp
bcc flnrts
beq flnrts
affrts
dey
jsr indlow
tax
dey
jsr indlow
bcs fndlnc
flinrt
clc
flnrts
rts
scrath
bne flnrts
scrtch
lda #0
tay
sta (txttab),y
iny
sta (txttab),y
sta trcflg ;reset trace flag
lda txttab
clc
adc #2
sta vartab
lda txttab+1
adc #0
sta vartab+1
runc
jsr stxtpt ;load (txtptr) with (txttab)-1
lda #0
clear
bne stkrts
clearc
jsr clall ;close all files
ldy #0
sty dsdesc ;flag 'no ds string'
dey ;y=$ff
sty trapno+1 ;flag no current trap line
sty errlin ;reset last error pointers
sty errlin+1
sty errnum
lda memsiz
ldy memsiz+1
sta fretop
sty fretop+1
lda #<stkbot
ldy #>stkbot
sta tos
sty tos+1
lda vartab
ldy vartab+1
sta arytab
sty arytab+1
sta strend
sty strend+1
ldx #pumony-puchrs ;reset print using chars
clrpu
lda pudefs,x
sta puchrs,x
dex
bpl clrpu
fload
jsr rstor3 ;reset pointer for data statements
stkini
ldx #tempst
stx temppt
pla
tay
pla
ldx #stkend-257
txs
pha
tya
pha
lda #0
sta oldtxt+1
sta subflg
stkrts
rts ;must return with .a=0
pudefs .byte ' ,.$' ;default: fill, comma, dec pnt, money symbol
stxtpt
clc
lda txttab
adc #$ff
sta txtptr
lda txttab+1
adc #$ff
sta txtptr+1
rts
;.end