-
Notifications
You must be signed in to change notification settings - Fork 82
/
rename.src
61 lines (51 loc) · 1.47 KB
/
rename.src
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
.messg "rename"
.subttl "rename"
.page
; 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 entsec+1
sta sector
jsr rdab ; read directory sector
jsr watjob
lda entind+1
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
; 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 filtrk,x
bne ck10
lda #flntfd ; input file not found
jmp cmderr
ck20 rts
chkio jsr chkin
ck25 lda filtrk,x
beq ck30
lda #flexst
jmp cmderr
ck30 dex
bpl ck25
rts