![]() ![]() |
These programs were written for CP/M and make use of the emulator traps in Tim Mann's xtrs Emulator.
IMPORT and EXPORT also work (with the exception of the -H option) when running CP/M on David Keil's Model 4/4P Emulator.
Export CP/M file(s) to the host operating system.
Usage: EXPORT [-H][-L][-T][-V] cpmfileref [hostfilename] Where: cpmfileref is the local file to export (use "?" and "*" to specify multiple files) hostfilename is the name of the file to create on the host (converted to uppercase by default), use -L to convert to lowercase and [ to toggle case of next character. -H switches emulator to high speed and restores speed when done. -L converts hostfilename to lowercase. -T export text file (CR LF becomes LF, stop at SUB character). -V (verbose) display "r" for block read, "w" for block written.
CP/M does not keep an accurate file size. Binary files are always multiples of 128 byte blocks; text files end at the first sub character.
The CP/M CCP converts all command line parameters to uppercase, hence the need of the -L option and the use of [ to toggle the case of the next character within the hostfilename.
EXPORT -LT HELPFILE.TXT README.TXT
EXPORT RUNME.COM
Imports a file from the host operating system to CP/M.
Usage: IMPORT [-F][-H][-L][-T][-V] hostfilename [cpmfilename] Where: hostfilename is the name of the file on the host (converted to uppercase by default), use -L to convert to lowercase and [ to toggle case of next character. cpmfilename is the name of the CP/M file to create, existing files will not be overwritten unless -F is used. -F overwrite existing files. -H switches emulator to high speed and restores speed when done. -L convert hostfilename to lowercase. -T import text file (LF becomes CR LF, add SUB at end of file). -V (verbose) display "r" for block read, "w" for block written.
CP/M does not keep an accurate file size, both binary and text files will be padded to multiples of 128 byte blocks.
The CP/M CCP converts all command line parameters to uppercase, hence the need of the -L option and the use of [ to toggle the case of the next character within the hostfilename.
IMPORT -LT README.TXT HELPFILE.TXT
IMPORT RUNME.COM
Controls miscellaneous functions of the xtrs emulator.
Usage: XTRS action [parameters] Where: action is one of the following: BOOT - reboot emulator CHANGE - signal disk change DEBUG - enter debugger EXIT - end emulator HIGHSPEED - high speed (autodelay off) MOUNT [-L] hostfilename disknum - mount disk NORMALSPEED - normal speed (autodelay on) REPORT - report status SYSTEM command - execute command on host UMOUNT disknum - umount disk hostfilename is the name of the virtual disk file on the host (converted to uppercase by default), use -L to convert to lowercase and [ to toggle case of next character. command is the command (and parameters) to execute on the host (converted to lowercase by default), use [ to toggle case. Note output from command is NOT displayed in the XTRS window. disknum is disk drive number (between 0 and 3 inclusive). -L converts hostfilename to lowercase.
The XTRS program assumes that the emulator's virtual disk files - diskM-U (where M is the TRS-80 model and U is the drive number) - are symbolic links. For example:
$ ls -l -rw-r--r-- 1 user group 213504 Mar 21 15:24 cpmutil.dsk lrwxrwxrwx 1 user group 10 Mar 5 12:40 disk4p-0 -> system.dsk lrwxrwxrwx 1 user group 11 Mar 7 13:49 disk4p-3 -> cpmutil.dsk -rw-r--r-- 1 user group 745984 Mar 24 17:38 system.dsk
The MOUNT action deletes the diskM-U file, replaces it with a symbolic link to the given filename and signals a disk change (as if F7 had been pressed).
The UMOUNT action deletes the diskM-U file and signals a disk change.
When changing disks, remember that CP/M must also be told of the disk change. This is usually done by pressing ctrl-C at the prompt.
XTRS MOUNT -L DATA.DSK 1
rm -f disk4p-1;test -f data.dsk && ln -s data.disk disk4p-1
XTRS UMOUNT 1
rm -f disk4p-1
Send Bug Reports and comments to Roland Gerlach.