$CA88/51848:   Perform [R] - Rename command

CA88: 20 20 C3  JSR $C320       ; get drive number from command line
CA8B: A5 E3     LDA $E3
CA8D: 29 01     AND #$01
CA8F: 85 E3     STA $E3         ; 2nd drive number
CA91: C5 E2     CMP $E2         ; compare with 1st drive number
CA93: F0 02     BEQ $CA97       ; same?
CA95: 09 80     ORA #$80

Jump from $CA93:

CA97: 85 E2     STA $E2
CA99: 20 4F C4  JSR $C44F       ; search for file in directory
CA9C: 20 E7 CA  JSR $CAE7       ; does name exist?
CA9F: A5 E3     LDA $E3
CAA1: 29 01     AND #$01
CAA3: 85 7F     STA $7F         ; drive number
CAA5: A5 D9     LDA $D9
CAA7: 85 81     STA $81         ; sector number
CAA9: 20 57 DE  JSR $DE57       ; read block from directory
CAAC: 20 99 D5  JSR $D599       ; ok?
CAAF: A5 DE     LDA $DE         ; pointer to directory entry
CAB1: 18        CLC
CAB2: 69 03     ADC #$03        ; pointer plus 3 to file name
CAB4: 20 C8 D4  JSR $D4C8       ; set buffer pointer
CAB7: 20 93 DF  JSR $DF93       ; get buffer number
CABA: A8        TAY
CABB: AE 7A 02  LDX $027A
CABE: A9 10     LDA #$10        ; 16 characters
CAC0: 20 6E C6  JSR $C66E       ; write name in buffer
CAC3: 20 5E DE  JSR $DE5E       ; write block to directory
CAC6: 20 99 D5  JSR $D599       ; ok?
CAC9: 4C 94 C1  JMP $C194       ; done, prepare disk status

    Previous Page / Next Page