-
Notifications
You must be signed in to change notification settings - Fork 84
/
jobs
118 lines (118 loc) · 1.4 KB
/
jobs
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
.PAGE 'JOBS'
;
; USE LASTJOB FOR DRIVE #
; CMD IS USED FOR JOB COMMAND
;
SETLJB
LDA LSTJOB,X
AND #1
ORA CMD
;
; SET JOB UP AND CHECK T&S
; .A=COMMAND FOR JOBS
; .X=JOB NUMBER
;
SETJOB
PHA
STX JOBNUM
TXA
ASL A
ASL A
ASL A
TAX
LDA HDRS+3,X
STA CMD ;SAVE SECTOR
LDA HDRS+2,X
BEQ TSERR
;
CMP #MAXTRK
BCS TSERR ;TRACK TOO LARGE
;
TAX
PLA ;CHECK FOR WRITE
PHA
AND #$F0
CMP #WRITE
BNE SJB1 ;NOT WRITE,SKIP CHECK
PLA
PHA
LSR A
BCS SJB2 ;DRIVE 1
;
LDA BAM0+2 ;GET VERSION #
BCC SJB3
SJB2
LDA BAM1+2 ;GET DRIVE 1 VER#
SJB3
BEQ SJB4 ;NO # IS OK, TOO
CMP VERNUM
BNE VNERR ;NOT SAME VERNUM #
;
SJB4
TXA ;RESTORE TRACK #
JSR MAXSEC
CMP CMD
BEQ TSERR
BCS SJB1 ;SECTOR IS OK!
;
;
; ILLEGAL TRACK AND SECTOR
;
TSERR
JSR HED2TS
TSER1
LDA #BADTS
JMP CMDER2
;
;
HED2TS
LDA JOBNUM
ASL A
ASL A
ASL A
TAX
LDA HDRS+2,X
STA TRACK
LDA HDRS+3,X
STA SECTOR
RTS
;
;
TSCHK
LDA TRACK
BEQ TSER1
CMP #MAXTRK
BCS TSER1
;
JSR MAXSEC
CMP SECTOR
BEQ TSER1
BCC TSER1
RTS
;
VNERR
JSR HED2TS
LDA #CBMV2 ;WRITE TO WRONG VERSION
JMP CMDER2
;
SJB1
LDX JOBNUM
LDA REVCNT ;SET RECOV COUNT
AND #$1F
STA ERRCNT,X
PLA
STA CMD
STA JOBS,X
STA LSTJOB,X
RTS
;
;
; DO JOB IN .A, SET UP ERROR COUNT
; AND LSTJOB. RETURN WHEN JOB DONE OK
; JMP TO ERROR IF ERROR RETURNS
;
DOIT STA CMD
DOIT2 LDA CMD
JSR SETJOB
JMP WATJOB
.END