-
Notifications
You must be signed in to change notification settings - Fork 82
/
save
118 lines (118 loc) · 1.86 KB
/
save
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
.PAG 'SAVE FUNCTION'
;***********************************
;* SAVE *
;* *
;* SAVES TO CASSETTE 1 OR 2, OR *
;* IEEE DEVICES 4>=N>=31 AS SELECT-*
;* ED BY VARIABLE FA. *
;* *
;*START OF SAVE IS INDIRECT AT .A *
;*END OF SAVE IS .X,.Y *
;***********************************
.SKI 3
SAVESP STX EAL
STY EAH
TAX ;SET UP START
LDA $00,X
STA STAL
LDA $01,X
STA STAH
;
SAVE JMP (ISAVE)
NSAVE LDA FA ***MONITOR ENTRY
BNE SV20
;
SV10 JMP ERROR9 ;BAD DEVICE #
;
SV20 CMP #3
BEQ SV10
BCC SV100
LDA #$61
STA SA
LDY FNLEN
BNE SV25
;
JMP ERROR8 ;MISSING FILE NAME
;
SV25 JSR OPENI
JSR SAVING
LDA FA
JSR LISTN
LDA SA
JSR SECND
LDY #0
JSR RD300
LDA SAL
JSR CIOUT
LDA SAH
JSR CIOUT
SV30 JSR CMPSTE ;COMPARE START TO END
BCS SV50 ;HAVE REACHED END
LDA (SAL)Y
JSR CIOUT
JSR STOP
BNE SV40
;
BREAK JSR CLSEI
LDA #0
SEC
RTS
;
SV40 JSR INCSAL ;INCREMENT CURRENT ADDR.
BNE SV30
SV50 JSR UNLSN
.SKI 5
CLSEI BIT SA
BMI CLSEI2
LDA FA
JSR LISTN
LDA SA
AND #$EF
ORA #$E0
JSR SECND
JSR UNLSN
;
CLSEI2 CLC
RTS
.SKI 5
SV100 CMP #2
BNE SV102
;
JMP RS232
;
SV102 JSR ZZZ ;GET ADDR OF TAPE
BCC SV10 ;BUFFER IS DEALLOCATED
JSR CSTE2
BCS SV115 ;STOP KEY PRESSED
JSR SAVING ;TELL USER 'SAVING'
SV105 LDX #PLF ;DECIDE TYPE TO SAVE
LDA SA ;1-PLF 0-BLF
AND #01
BNE SV106
LDX #BLF
SV106 TXA
JSR TAPEH
BCS SV115 ;STOP KEY PRESSED
JSR TWRT
BCS SV115 ;STOP KEY PRESSED
LDA SA
AND #2 ;WRITE END OF TAPE?
BEQ SV110 ;NO...
;
LDA #EOT
JSR TAPEH
.BYT $24 ;SKIP 1 BYTE
;
SV110 CLC
SV115 RTS
.SKI 3
;SUBROUTINE TO OUTPUT:
;'SAVING <FILE NAME>'
;
SAVING LDA MSGFLG
BPL SV115 ;NO PRINT
;
LDY #MS11-MS1 ;'SAVING'
JSR MSG
JMP OUTFN ;<FILE NAME>
.END