85 lines
2.2 KiB
Plaintext
85 lines
2.2 KiB
Plaintext
KCPMTK : KYLE'S CP/M TOOLKIT
|
|
|
|
This is a collection of programs and source libraries that are
|
|
useful for working with CP/M.
|
|
|
|
|
|
TOOLS
|
|
|
|
- DUMP.COM, UNDUMP.COM
|
|
|
|
DUMP outputs a hexadecimal-encoded version of a file along with
|
|
an address counter. UNDUMP takes this output and can return an
|
|
Intel hex version or produce a binary file.
|
|
|
|
The original purpose of this repository was to write UNDUMP, which
|
|
reverses the output of the DUMP.COM utility. After working with a
|
|
CP/M which didn't have DUMP.COM, I wrote my own version.
|
|
|
|
- DOWNLOAD.COM, UPLOAD.COM
|
|
|
|
A pair of tools that mimics the utility shipped with the RC2014,
|
|
which comes by way of Grant Searle's tools.
|
|
|
|
|
|
LIBRARIES
|
|
|
|
1. COMMON.PAS
|
|
|
|
COMMON is a collection of routines that are, you guessed it, commonly
|
|
useful.
|
|
|
|
Types
|
|
-----
|
|
|
|
- FilePath is a string used for storing filenames on CP/M.
|
|
|
|
|
|
2. BINARY.PAS
|
|
|
|
BINARY is a collection of routines for handling binary data. It has
|
|
functions for dealing with digits (e.g. Byte values in the range
|
|
$0 .. $F), bytes, and words. When dealing with invalid values, the
|
|
code returns 0 instead of a garbage value. This is an arbitrary
|
|
choice.
|
|
|
|
Types
|
|
-----
|
|
|
|
- BStr ('byte string') defines a string for containing an hex-
|
|
encoded byte.
|
|
- WStr ('word string') defines a string for containing a hex-
|
|
encoded word.
|
|
- BinFile is a file of bytes.
|
|
|
|
Procedures
|
|
----------
|
|
|
|
- Procedure ExpandFile(var fil : BinFile; var pos : Integer; pad : Integer);
|
|
|
|
ExpandFile will pad out the file with enough bytes. The `pos` parameter
|
|
is used to track the file position after expansion.
|
|
|
|
- function ValidHexDigit(bval: Byte): Boolean;
|
|
|
|
Returns True if the byte is between the range of $0 .. $F.
|
|
|
|
- function ReadDigit(bchr: Char): Byte;
|
|
|
|
ReadDigit converts a single character representing an octal, decimal,
|
|
or hexadecimal digit to a byte; the octal and decimal support are
|
|
incidental.
|
|
|
|
- function ReadByte(bstr : BStr): Byte;
|
|
function ReadWord(bstr : WStr): Integer;
|
|
|
|
Given a string that contains a hex-encoded byte or word, return the
|
|
decoded value.
|
|
|
|
- function WriteByte(bval : Byte): BStr;
|
|
function WriteWord(bval : Integer): WStr;
|
|
|
|
Given a byte or word value, return its hex-encoded string
|
|
representation.
|
|
|