Display file to be renamed 00010 SNAMER PSHS X Preserve register 00020 LDU #RENAME "Rename:" 00030 JSR CPRINT Print it 00040 LDU ,S Get Directory pointer from stack 00050 JSR DISPFL Display filename 00060 LDU #TO "To:" 00070 JSR PRINT Print it 00080 LDU ,S Get Directory pointer from stack 00090 JSR DISPFL Display filename 00100 PULS U Remove pointer from stack 00110 STU SECTS And Save it 00120 LDX #NAMBUF Name Buffer 00130 JSR FILLBF Copy File Name to Buffer 00140 LDU #NAMBUF Name Buffer 00150 LDX #$428 Screen location of file name 00160 SRENAM LDA #$5E up Arrow (^) 00170 STA 32,X place under file name (cursor) User inputs 00180 SRLOOP JSR [$A000] Read Keyboard 00190 BEQ SRLOOP If no keypress, then loop 00200 LDB #96 Blank space 00210 STB 32,X Erase cursor 00220 CMPA #13 ENTER? 00230 BEQ SRNAMD Go Rename File 00240 CMPA #8 Backspace? 00250 BNE SNOTBS If no then skip 00260 CMPX #$428 First character in filename? 00270 BEQ SRENAM If yes, ignore Backspace 00280 SENDBF LEAU -1,U Previous character in name 00290 LEAX -1,X Move back 1 character on screen 00320 BRA SRENAM Go get another keypress 00330 SNOTBS CMPA #9 Right arrow? 00340 BNE SNOTTB If no then skip 00350 CMPX #$42F Last character in filename? 00360 BEQ SRENAM If yes, ignore right arrow 00370 LEAU 1,U Next character in name 00380 LEAX 1,X Advance 1 character on screen 00410 BRA SRENAM Go get another keypress 00510 SNOTTB CMPA #3 BREAK? 00520 LBEQ MAIN If yes, then go to Main Routine 00530 STX $88 Save Screen Pointer 00540 JSR [$A002] Display Character 00550 LEAX 1,X Advance 1 character on screen 00560 STA ,U+ Insert Character in filename 00590 CMPX #$430 End of filename? 00600 BEQ SENDBF If yes, move pointers back 00610 BRA SRENAM Go get another keypress Rename File 00620 SRNAMD LDU #$400 Command Buffer 00640 LDD #$523A "R:" (Rename Command) 00660 STD ,U++ Send to command buffer 00670 LDX SECTS Get old file name 00680 BSR SXFR Send to command buffer 00690 LDX #NAMBUF Get new file name 00700 BSR SXFR Send to command buffer 00710 LDD #$E000 "Extended" command 00715 LDU #$400 Command Buffer 00720 JSR COMMSD Execute command 00730 JMP VIRT Return to main virtual menu Transfer filename to command buffer 00740 SXFR LDD ,X++ Get 1st 2 bytes of filename 00750 STD ,U++ Store in command buffer 00760 LDD ,X++ Get 2nd 2 bytes of filename 00770 STD ,U++ Store in command buffer 00780 LDD ,X++ Get 3rd 2 bytes of filename 00790 STD ,U++ Store in command buffer 00800 LDD ,X++ Get Last 2 bytes of filename 00810 STD ,U++ Store in command buffer 00820 LDA #'. "Dot" 00830 STA ,U+ Store in command buffer 00840 LDD ,X++ Get 1st 2 bytes of Extension 00850 STD ,U++ Store in command buffer 00860 LDA ,X+ Get Last byte of Extension 00870 STA ,U+ Store in command buffer 00875 CLR ,U+ Terminate command 00880 RTS Return to calling routine