Universal manipulation program for disk work POWER Version 3.07 Copyright by PAVEL BREDER 1981, 1982, 1983 Cleanup and reformatting by Jerry Davis (netzener.net) 1. Using POWER 2. General commands 3. Commands for working with the directory 4. Commands for working with files 5. Commands for working with memory 6. Commands for reading/writing sectors 7. Commands for disks 8. Options 9. Installation 1. Using POWER POWER is a universal utility program that supports working with files on floppy disks, as well as the handling of memory. The current version of POWER with its large number of commands is particularly suitable for the system system programmer. The application programmer should use POWER with with great care, as the disk contents can easily be destroyed by writing to sectors with the directory or data files. The same care should be taken when accessing memory, as POWER commands can destroy all memory contents including those of the CP/M operating system. POWER is loaded from any drive and responds with a copyright message and the drive prompt. e.g: POWER 3.03 on CP/M 2.2 1/2 Copyright (c) 1981, 1982, 1983 by PAVEL BREDER All rights reserved. 01/03/83 A=? POWER now expects the input of a command. Some commands display the directory (or file groups) on the screen with a sequential number. This number is used to identify the file and for further processing of the command. After the "Select:" prompt, you can select one, several, or groups of files using these numbers. The digits must be separated from each other by spaces. Ranges are marked by beginning and end number connected with a minus (-). If the end of a range is missing, the last file number is automatically used. For example: 1 5 9 (files 1,5 and 9) 1-7 (files 1 to 7) 12- (files 12 to end) File name wildcards can be used to specify groups of files to be acted on. The display and selection then only takes place for this wildcard. A drive designation before this wildcard specification or even just the drive designation alone make the command effective on the specified drive. If the file name is unique, the menu is omitted and the command is immediately executed with that file name. If floppy disks are changed while working with POWER, a ^C must be entered to log in the new diskette. A ^C also interrupts any command, while ESC cancels a command. The character BS(backspace) or DEL allows you to correct a command line before entering the final RETURN. Use ^X to delete the entire command line. Entering ^P allows the log function to be switched on/off via the connected printer. This setting is independent of the BDOS function ^P, i.e. when POWER is terminated, the printing of screen screen output is automatically canceled. In addition, further options can be specified for each command, enclosed in square brackets. If this information is missing, application defaults are used. Defaults can be displayed on the screen with the LOG command. The current value of the options displayed with the LOG command can be changed by entering the code letter enclosed in square brackets. Each entry toggles the option. It is also possible to set several options at the same time, e.g. A=[vp] File names If a command is only to be applied to a previously specified file or group, the file name can be specified in the usual CP/M form after the command, e.g. COPY drive:filename. The wildcard characters ? and * can be used for file groups: REN *.BAK REN DATE.* ERA A??.* The *** string This string stands for “all files”. After listing the directory the required command is applied to all files one after the other. Files with the status “R/O” are skipped when certain functions (REN, ERA...) are skipped. The *.* string This combination also means “all files”. For certain functions (REN, ERA...), the "SELECT?" prompt is displayed after the directory. 2. General commands : - Select another drive USER - Set current user (0-15) XUSER - Set destination user (0-15) EXIT - Exit POWER, return to CP/M LOG - Display of options and memory allocation SPEED - Control of the display output speed PASS - Password entry (CP/M 3.x only) UR1 - User command 1 UR2 - User command 2 UR3 - User command 3 UR4 - user command 4 USER - Set current user (0-15) Example: USER 1 USER 8 XUSER - Set destination user (0-15) Example: USER 3 USER 5 EXIT - Exit POWER, return to CP/M Exit from POWER with memory test (? if error), return to operating system. Exit POWER with memory test (? if error), return to operating system. ? - List of possible commands If an incorrect command is entered, the help function recommended. LOG - Display of options and memory allocation Also displays free user memory. Option switches can be placed in square brackets. Each entry toggles the option on or off. See OPTIONS command! SPEED - Control of the display output speed Example: SPEED i i = 0...9 (0 - fast, 9 - very slow) The output speed can also be changed during the execution of a command e.g. TYPE) by pressing the keys 0 to 9. PASS - Password entry (CP/M 3.x only) UR1 - User command 1 UR2 - User command 2 UR3 - User command 3 UR4 - user command 4 If user commands are installed, they can be called up. They must be specified in the following memory locations of POWER:\ UR1 140..147H UR2 148..14FH UR3 150..157H UR4 158..15FH 3. Commands for working with the directory DIR - Display disk directory REN - Rename file ERA - Delete file SORT - Sort the floppy disk directory SETRO - Set file to read-only status SETWR - Set file to read-write status SETDIR - Set file to normal status SETSYS - Set file to system status SET - Display/set/reset any attributes SIZE - Display the disk space allocation of a file RECLAIM - Restore deleted files GROUP - Display the block numbers occupied by a file CHECK - Display the checksum of a file DIR [UXi] Display disk directory U - all USER areas X - all logged-in drives i - i=1..9 Number of columns for displaying the directory Labeling of the files: * - file is R/O (read-only) (..) - file is SYS (system-protected) > - File is original file during copy operations < - file becomes the copy during copy operations The [S] option can be used to suppress the display of system files. REN Rename file(s) The selected files can be renamed. A prompt will request the new file name. Entering an asterisk “*” in the name or the extension leaves the existing name or extension unchanged: *.ext --> sets a different extension name.* --> sets a different file name ERA [R] Delete file(s) If the [R] option is specified, a query is made for each file as to whether it should actually be deleted. SORT i Sorts directory contents for display The files are displayed sorted: i = 0 unsorted i = 1 sorted by file name i = 2 as 1, SYS files last i = 3 sorted by name extensions i = 4 as 3, SYS files last SETRO Set R/O attribute (t1) SETWR Reset R/O attribute (t1) Only files that are changed are displayed during command execution. SETDIR Reset SYS attribute (t2) SETSYS Set SYS attribute (t2) Only files that are changed are displayed during command execution. SET Display file attributes SET [+{1..8,S,R,X}] Set file attributes SET [-{1..8,S,R,X}] Reset file attributes Used to set (+) or reset (-) the high bit of the corresponding character of the file name (1-8) or extension (S,R,X) according to the following table: Filename characters 1 POWER: File marker for “Original file” 2 POWER: “Copy” file marker, public flag (for ZSDOS/ZDDOS) 3 Enter access date (for DateStamper) 4 User flag 5,6,7 reserved for operating system 8 Access protection (e.g. in Z-System) Extension characters S=t1 File is system file R=t2 Read-only status X=t3 Archive flag SIZE Shows the size of a file Displays file size in sectors, free sectors, kilobytes and total allocation blocks. RECLAIM Restore deleted files Files that have been deleted are undeleted if the allocation block chain is still valid. GROUP Shows allocation blocks assigned to a file Allocation blocks are storage units assigned to files in the directory. The allocation block number of each block used is displayed preceded by the extent number for those blocks. CHECK Display file checksum Calculates a CRC checksum for the selected files. 4. commands for working with files TYPE - Display files COPY - Copy files LOAD - Load a file into memory SAVE - Save a memory area to diskette AUTO - Specify the default drive for the RUN command RUN - Load and start a COM file from the default drive GO - Load and start a binary file EX - Start a program and return to POWER JP - Start a program and return to CP/M TYPE Display ASCII files as text TYPEA sector-by-sector display in ASCII TYPEH sector-by-sector display in HEX TYPEX sector-by-sector display in HEX and ASCII ^K ends the output, the next file is displayed. COPY Copy files The selected files are copied to another drive. Various options control the copying process: [A] automatic overwriting of existing files (overlay) [B] automatic renaming of existing files to *.BAK (back up) [C] ask if file already exists (ask) [D] do not copy if file exists (skip) [T] sets the order of copying according to size [M] marks original and copied files [Q] changes the name during copying (rename) [Z] deletes source file after copying (move) LOAD filename address - Loads file into memory The file is not changed. The area of POWER and the end of the TPA must not be overwritten (see LOG). SAVE filename address [sect] - Save memory area starting at 'address' to a file The save operation is executed for the specified number of 128 byte sectors. Sectors can be omitted if the data in memory was previously loaded with LOAD. AUTO drive: - Sets the drive for RUN command If a file name without an LW designation is specified for the RUN command, then POWER attempts to load this program file from the drive that was defined with the AUTO command. RUN [filename param] - Loads and starts the .COM file ufn Parameters may be specified as they would normally appear in the CP/M command line. GO filename address - Loads file 'filename' at address 'address' and starts it EX address [arg] - Starts program at address 'address' JP address arg - Starts program at address 'address' RET returns to the operating system. arg is command line as in the CP/M operating system. operating system. 5. commands for working in the memory DUMP - display memory contents FILL - Fill memory area with specified bytes MOVE - Restore DS - Display and change memory contents byte by byte CM - Compare two memory contents SEARCH - Search for byte sequences in memory DUMP [address] Display memory area in ASCII DUMPA [address] Display memory area in ASCII without tabs DUMPH [address] Display memory area in HEX DUMPX [address] Display memory area in HEX and ASCII The data in memory address 'address' is displayed as text. Non-printable characters are not displayed. If the address is missing, the display starts at 0h and then from the last address displayed. The address can be entered as follows: . - 128 bytes from the last displayed address ,i - i bytes from the last displayed address ,, - further from last displayed address adr - 1 byte from address adr,i - i bytes from address adr, - 128 bytes from address adr,, - all bytes FILL start end byte - Fills memory from 'start' address to 'end' address with byte All values (start,end,byte) must be specified in hexadecimal. MOVE start end start2 - Memory transport The memory area 'start' to 'end' is moved to 'start2'. The transport takes place in ascending order, overlapping must be avoided. DS address,length - Display and change memory contents From the address 'address', the bytes are displayed individually in hexadecimal, binary, as ASCII characters and decimal. It is then possible to enter a new value can be entered. A letter placed in angle brackets indicates the form of the input (H-hexadecimal, D-decimal, B-binary, A-character where a preceding ^ hides bits 5 to 7 from the character/CTRL/). The following inputs switch between the individual input formats: .h hexadecimal inputs follow .d decimal inputs follow .b binary inputs follow .a character inputs follow ... the DS command is terminated CM start end start2 - Compares memory start..end with start2 A byte-by-byte comparison of the memory contents is carried out and any differences with address and content are displayed. SEARCH start end byte... - Searches memory for bytes Search address 'start' through 'end' for 'byte' bytes. The bytes found are displayed with their address. The bytes to be searched for must be separated by a blank character. 'byte' can be specified as: ? any byte, displays all bytes of the range “x” ASCII characters (strings) to be searched for in quotation marks 6. Commands for physically reading/writing diskette READ - Read disk sector by sector WRITE - Write disk sector by sector READGR - Read one or more recording blocks WRITEGR - Write one or more recording blocks READ trk sec [type nsec] - Read sector from diskette READGR ngroup [type nsec] - Read block from diskette From track 'trk', sector 'sec', 'nsec' sectors are read from the current drive. If 'nsec' is missing one sector is read. If the 'type' specification is missing or if 'type' is not an address, the memory area 80H..0FFH is used. 'type' can be: XX - HEX and ASCII representation XH - HEX representation XA - ASCII representation address - no display, but store sector in specified memory area READGR works like READ, but with specification of the logical block number instead of track/sector. The block number 'ngroup' corresponds to the information in the directory, see also GROUP command. WRITE trk sec [address nsec] - Write sector to diskette WRITEGR ngroup [address nsec] - Write block to diskette After track 'trk', sector 'sec' of the current drive, 'nsec' sectors are written from the memory area 'address'. If 'address' is missing, then the memory area 80H..0FFH is used. If nsec is missing, then one sector is written. WRITEGR works like WRITE, but with specification of the logical block number instead of track/sector. The block number 'ngroup' corresponds to the information in the directory, see also GROUP command. 7. Commands for disks TEST - Test all sectors of a diskette. Repair or remove defective sectors. STAT - Display of the available and free disk space on diskette RESET - Log off drive DISK - Display disk parameters TEST [S] - Test of the disk for readability Test program for reading all sectors of the disk (including the system tracks with option 'S'). Faulty sectors are indicated by “*”, the faulty sectors are listed with track and sector. Finally, the CRC checksum of the entire disk is displayed. If a faulty sector is found within an allocation block, the following functions can be used: SAVE Y/N - All faulty sectors are saved in a file and the faulty sectors can no longer be used. This file receives SYS and R/O status to prevent accidental deletion. SHOW BAD FILES Y/N - All affected files are displayed. REPAIR Y/N - Attempt to rewrite bad sectors. STAT [drive] - Display free disk space on all active drives RESET [drive] - Resets drive d This command allows you to reset individual drives as though the disk had been changed. With ^C all drives can be reset. DISK [drive] - Display drive 'drive' status Display of the physical and logical parameters of a drive. 8. POWER Options The options listed below can be entered separately in the command line or in addition to a command. The corresponding option must be enclosed in square brackets. Some of the options function like a switch (On/Off) and can be set or reset at any time by entering the option again. If an option is not specified or missing, the default value is used which can be displayed with the LOG command. The function described in the overview for each option is executed when the status is “ON”. General options i (1..9) - Specifies the number of columns for displaying the directory $ - Create a SUBMIT file $$$.SUB for automatic return to POWER after the RUN command F - Search for COM files on the drive specified with AUTO (RUN) P - Page mode. Output stops after the display of 24 screen lines. R - Before executing the command, the following prompt appears: Y/N ? S - Display system files U - Display the directory for all USER areas X - Display the directory of all drives that are online POWER Options for COPY A - File with the same name is overwritten B - The existing file is renamed to .BAK C - When COPY is executed, the following message appears if the file already exists: file exists, (B)ackup, (O)verwrite, (S)kip B: like option B, O: like option A, S: like option D D - Don't copy if file with the same name exists M - Mark the original file (>) and copy (<) Q - Rename the file copy if possible (each file individually) T - ON: Abort if there is no space for the file to be copied OFF: Attempt to copy a smaller file V - Write check (read after write) Z - Delete source file after copying 9. Installation The first sectors of POWER.COM (addresses 100H...2FFH) contain various options which can be used to influence the operation of POWER. It is best to use POWER itself for patching: - first determine the size of POWER.COM (SIZE command) - change the desired values with the DS command - Select the standard setting of the options (commands [ ]) - Save POWER.COM again with SAVE POWER.COM 100 xx The following addresses refer to POWER 3.07. and contain only the tested configuration bytes. For other versions there may be differences. Address Description Default Value 0100-0101 JP start C3 10 03 0103-0104 Reserved for MP/M systems 1A 02 0105 Number of lines for page mode 18 (24d) (00 or bit7=1 means scrolling, option [P]) 0106 Character for TYPEx for transition to next file 0B (^K) 0107 POWER's prompt 3D (=) 0108 Command character for DS 2E (.) 0109 Character code for change of direction for DS 7E (~) Address Description Default Value 010A Character for file with faulty sectors 3D (=) 010B Button for canceling any command 1B (ESC) 010C Display for TEST command (0=no display, 01 1=star for each sector, FF= complete sector info) 010D BDOS error mode (only for CP/M 3.x) FF 010E Display mode for DIR command FF (0=standard, 1=wide, FF=wide with numbers) 010F Stop screen output except ^S and Space 20 ( ) 0110-0111 Storage of the system stack (used for EXIT) 63 EB 0113 Separator for directory output 00 011A Response to read error (COPY, LOAD) 01 (0=abort, 1=ask for continuation, FF=ignore) 011B Fill byte for faulty sector (TEST, COPY, LOAD) E5 011E Display of copyright 01 (0 for BOOT and ^C, 1 only for BOOT, FF never) 0120-013F Program part that is executed with every ^C C9 ... (e.g. RAM test in the entire TPA) Address Description Default Value 0140-0147 Routine UR1 C9 FF FF FF FF FF FF FF 0148-014F Routine UR2 C3 24 04 FF FF FF FF FF 0150-0157 Routine UR3 C3 29 04 FF FF FF FF FF 0158-015F Routine UR4 C3 D3 04 FF FF FF FF FF 0164 Number of columns i for directory display 03 0169 Default value for SPEED (0=fast, 9=slow) 00 0190 USER range set with AUTO for RUN 00 0191 Drive set with AUTO for RUN 01 (A:) 0192 Response to incorrect command 00 (0 - reference to HELP function, 1 - execute HELP, FF - execute HELP even with faulty arguments) 01D0-02EF Command list, each separated by 20H ... 20 00 02F0 Drive + status for option [$] 00 (A:) (OFF: Bit7 is set, drive in bit 0-3) 02F1-02FF Command for $$$.SUB 'POWER'