-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathinit
115 lines (115 loc) · 1.82 KB
/
init
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
.PAG 'INIT'
INIT JSR INITV ;GO INIT VECTORS
JSR INITCZ ;GO INIT CHARGET & Z-PAGE
JSR INITMS ;GO PRINT INITILIZATION MESSAGES
LDX #STKEND-256 ;SET UP END OF STACK
TXS
JMP READY ;GO TO READY
.SKI 6
INITAT INC CHRGET+7
BNE CHDGOT
INC CHRGET+8
CHDGOT LDA 60000
CMP #':
BCS CHDRTS
CMP #'
BEQ INITAT
SEC
SBC #'0
SEC
SBC #$D0
CHDRTS RTS
.BYT 128,79,199,82,88
.SKI 6
INITCZ LDA #76
STA JMPER
STA USRPOK
LDA #<FCERR
LDY #>FCERR
STA USRPOK+1
STY USRPOK+2
LDA #<GIVAYF
LDY #>GIVAYF
STA ADRAY2
STY ADRAY2+1
LDA #<FLPINT
LDY #>FLPINT
STA ADRAY1
STY ADRAY1+1
LDX #INITCZ-INITAT-1
MOVCHG LDA INITAT,X
STA CHRGET,X
DEX
BPL MOVCHG
LDA #STRSIZ
STA FOUR6
LDA #0
STA BITS
STA CHANNL
STA LASTPT+1
LDX #1
STX BUF-3
STX BUF-4
LDX #TEMPST
STX TEMPPT
SEC ;READ BOTTOM OF MEMORY
JSR $FF9C
STX TXTTAB ;NOW TXTAB HAS IT
STY TXTTAB+1
SEC
JSR $FF99 ;READ TOP OF MEMORY
USEDEF STX MEMSIZ
STY MEMSIZ+1
STX FRETOP
STY FRETOP+1
LDY #0
TYA
STA (TXTTAB)Y
INC TXTTAB
BNE INIT20
INC TXTTAB+1
INIT20 RTS
.SKI 6
INITMS LDA TXTTAB
LDY TXTTAB+1
JSR REASON
LDA #<FREMES
LDY #>FREMES
JSR STROUT
LDA MEMSIZ
SEC
SBC TXTTAB
TAX
LDA MEMSIZ+1
SBC TXTTAB+1
JSR LINPRT
LDA #<WORDS
LDY #>WORDS
JSR STROUT
JMP SCRTCH
.SKI 4
WORDS .BYT ' BYTES FREE',13,0
FREMES .BYT 147,'**** CBM BASIC V2 ****',13,0
.SKI 4
BVTRS .WOR NERROR,NMAIN,NCRNCH,NQPLOP,NGONE,NEVAL
;
INITV LDX #INITV-BVTRS-1 ;INIT VECTORS
INITV1 LDA BVTRS,X
STA IERROR,X
DEX
BPL INITV1
RTS
.SKI 4
PANIC JSR CLSCHN ;WARM START BASIC...
LDA #0 ;CLEAR CHANNELS
STA CHANNL
JSR STKINI ;RESTORE STACK
CLI ;ENABLE IRQ'S
JMP READY ;DISPLAY READY ENTRY
CHKE0 .BYT $00
;
;PROGRAM LOAD PATCH
;
PLINK JSR LNKPRG ;GO LINK THE LOADED PROGRAM
JMP FLOAD ;USE NORMAL ENTRY TO KEEP VARIABLES
.END