-
Notifications
You must be signed in to change notification settings - Fork 84
/
newss
105 lines (105 loc) · 1.67 KB
/
newss
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
.PAGE 'NEWSS'
;*********************************
;* NEWSS: GENERATE NEW SS & FIX *
;* OLD SS'S TO REFLECT IT.*
;* VARS: *
;* REGS: *
;* *
;*********************************
;
NEWSS
JSR NXTTS ;GET T&S BASED ON HDR
JSR DBLBUF ;USE INACTIVE BUFFER
JSR SCRUB
JSR GETACT
PHA
JSR CLRBUF
LDX LINDX
LDA SS,X ;SET REGS FOR TRANSFER
TAY
PLA
TAX
LDA #SSIOFF ;# OF CHARS
JSR B0TOB0 ;TRANSFER AT BUF(0)
;
LDA #0
JSR SSDIR
LDY #2
LDA (DIRBUF)Y ;GET SS #
PHA
LDA #0
JSR SETPNT
PLA
CLC
ADC #1
STA (DIRBUF)Y ;PUT SS # IN NEW SS
ASL A
ADC #4
STA R3 ;SAVE POSITION
TAY
SEC
SBC #2
STA R4
LDA TRACK
STA R1 ;SAVE FOR SS UPDATE
STA (DIRBUF)Y ;PUT TRACK IN SS
INY
LDA SECTOR
STA R2 ;SAVE FOR SS UPDATE
STA (DIRBUF)Y ;PUT SECTOR IN SS
LDY #0
TYA
STA (DIRBUF)Y ;NULL LINK
INY
LDA #SSIOFF+1 ;PTR TO LAST BYTE
STA (DIRBUF)Y
;
LDA #SSIOFF
JSR SETPNT
JSR WRTAB
JSR WATJOB
;
NS20
LDX LINDX
LDA SS,X ;GET SS BUFFER #
PHA
JSR GAFLGS
LDX LINDX
STA SS,X ;SWAP ACT-BUF & SS
PLA
LDX LBUSED
STA BUF0,X
;
LDA #0
JSR SETPNT ;SET LINK TO NEW SS
LDY #0
LDA TRACK
STA (DIRBUF)Y
INY
LDA SECTOR
STA (DIRBUF)Y
JMP NS50
NS40
JSR GETACT
LDX LINDX
JSR IBRD ;READ NEXT SS
LDA #0
JSR SETPNT ;PTR=0
NS50
DEC R4
DEC R4
LDY R3 ;GET NEW SS LINK PTR
LDA R1
STA (DIRBUF)Y ;PUT TRACK IN
INY
LDA R2
STA (DIRBUF)Y ;PUT SECTOR IN
;
JSR WRTOUT ;WRITE IT BACK...
JSR WATJOB ;...& WAIT
LDY R4
CPY #3
BCS NS40 ;MORE SS TO UPDATE!
;
JMP DBLBUF ;RESET ACTIVE BUFFER
.END