forked from mist64/msbasic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sym1_loadsave.s
70 lines (58 loc) · 1.2 KB
/
sym1_loadsave.s
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
.segment "CODE"
SAVE:
beq L2739
sta P1L
jsr CHRGET
bne NULL-1
lda TXTTAB
ldy TXTTAB+1
sta P2L
sty P2H
lda VARTAB
ldy VARTAB+1
sta P3L
sty P3H
ldy #$80
jsr USR2
bcs LC6DD
lda #<SAVED
ldy #>SAVED
jmp STROUT
LOADED:
.byte "LOADED",CR,LF
.byte "OK",CR,LF,0
SAVED:
.byte "SAVED",CR,LF,0
LOAD:
beq L2739
sta $A64E
jsr CHRGET
bne L2738
ldy #$80
jsr USR3
bcs LC6EF
lda #<LOADED
ldy #>LOADED
jsr STROUT
ldx P3L
ldy P3H
txa
stx VARTAB
sty VARTAB+1
jmp FIX_LINKS
LC6DD:
lda #<BAD_SAVE
ldy #>BAD_SAVE
jmp STROUT
BAD_SAVE:
htasc "BAD SAVE"
.byte CR,LF,0
LC6EF:
lda #<BAD_LOAD
ldy #>BAD_LOAD
jsr STROUT
jsr SCRTCH
jmp RESTART
BAD_LOAD:
htasc "BAD LOAD"
.byte CR,LF,0