-
Notifications
You must be signed in to change notification settings - Fork 82
/
hdrename
64 lines (64 loc) · 1.07 KB
/
hdrename
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
; RENAME FILE NAME IN DIRECTORY
RENAME JSR ALLDRS ;SET BOTH DRIVE #'S
LDA FILDRV+1
AND #1
STA FILDRV+1
CMP FILDRV
BEQ RN10 ;SAME DRIVE #'S
ORA #$80 ;CHECK BOTH DRIVES FOR NAME
RN10 STA FILDRV
JSR LOOKUP ;LOOK UP BOTH NAMES
JSR CHKIO ;CHECK FOR EXISTENCE
LDA FILDRV+1
AND #1
STA DRVNUM
LDA ENTSEC+1
STA SECTOR
LDA ENTTRK+1 ;<HD>
STA TRACK ;<HD>
JSR RDAB ;READ DIRECTORY SECTOR
JSR WATJOB
LDA ENTIND+1 ;<FIX>
CLC ;SET SECTOR INDEX
ADC #3 ;...+3
JSR SETPNT
JSR GETACT
TAY
LDX FILTBL
LDA #16
JSR TRNAME ;TRANSFER NAME
JSR WRTOUT ;WRITE SECTOR OUT
JSR WATJOB
JMP ENDCMD
.SKIP
.PAG 'CHK EXISTANCE'
; CHECK I/O FILE FOR EXIST
CHKIN
LDA PATTYP+1 ;1ST FILE BEARS TYPE
AND #TYPMSK
STA TYPE
;
LDX F2CNT
CK10 DEX
CPX F1CNT
BCC CK20
LDA FILSEC,X ;<HD>
CMP #255 ;<HD>
BNE CK10
LDA #FLNTFD ;INPUT FILE NOT FOUND
JMP CMDERR
CK20
RTS
;
CHKIO
JSR CHKIN
CK25 LDA FILSEC,X ;<HD>
CMP #255 ;<HD>
BEQ CK30
LDA #FLEXST
JMP CMDERR
CK30 DEX
BPL CK25
RTS
.SKIP
.END