-
Notifications
You must be signed in to change notification settings - Fork 82
/
save
119 lines (119 loc) · 1.89 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
119
.PAG 'SAVE FUNCTION'
;***************************************
;* NSAVE 10/30/81 *
;* *
;* SAVES TO CASSETTE 1 OR 2, OR *
;* IEEE DEVICES 4>=N>=31 AS SELECTED *
;* BY VARIABLE FA. *
;* *
;* .X => ZPAGE ADDRESS OF START VECTOR *
;* .Y => ZPAGE ADDRESS OF END VECTOR *
;***************************************
.SKI 3
NSAVE LDA 0,X ;GET START VECTOR
STA STAL
LDA 1,X
STA STAH
LDA 2,X
STA STAS
TYA
TAX
LDA 0,X ;GET END VECTOR
STA EAL
LDA 1,X
STA EAH
LDA 2,X
STA EAS
;
LDA FA
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
LDX I6509 ;INDIRECTS SWITCHED BY RD300
JSR RD300
LDA SAL
JSR CIOUT
LDA SAH
JSR CIOUT
;
LDY #0
SV30 JSR CMPSTE ;COMPARE START TO END
BCS SV50 ;HAVE REACHED END
LDA (SAL)Y
JSR CIOUT
JSR INCSAL
JSR STOP
BNE SV30
;
STX I6509 ;RESTORE INDIRECTS
BREAK JSR CLSEI
LDA #0
SEC
RTS
;
SV50 STX I6509 ;RESTORE INDIRECTS
JSR UNLSN
.SKI 5
CLSEI BIT SA
BMI CLSEI2
LDA FA
JSR LISTN
LDA SA
AND #$EF
ORA #$E0
JSR SECND
JSR UNLSN
;
CLSEI2
SV110 CLC
SV115 RTS
.SKI 5
SV100 CMP #2
BNE SV102
;
JMP RS232
;
SV102 JSR ZZZ ;GET ADDR OF TAPE
BCS SV115 ;BUFFER IS DEALLOCATED...EXIT
JSR CSTE2
BCS SV115 ;STOP KEY PRESSED
JSR SAVING ;TELL USER 'SAVING'
SV105 LDA #BLF
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
JMP TAPEH
.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