home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
ZCPR33
/
Z3-33
/
Z33ANOTE.0Z1
/
Z33ANOTE.001
Wrap
Text File
|
2000-06-30
|
2KB
|
37 lines
ZCPR33 APPLICATION NOTES
========================
Note Number: 001
Author: Jay Sage
Date: June 6, 1987
The Correct Value for Z3CLS in Z3BASE.LIB
In "ZCPR3, The Manual" Richard Conn nowhere explains in precise terms
the value that should be used for Z3CLS, the size of the command line
buffer. Because of the way it is used in the command processor code, the
correct value for this symbol is the maximum number of command characters
that can fit in the command line buffer. This count does not include the
required terminating null. An example should help make this clearer.
Suppose you allocate the standard space of 0D0H bytes (208 decimal) for
the multiple command line memory module. The first two bytes are used as a
pointer to the next command to execute. The next byte contains the length
of the buffer (Z3CLS) for use by the DOS read-line function. The next byte
will be filled in by the DOS read-line function to contain the actual length
of the command line entered. Finally, at offset 4 (the fifth byte) in the
multiple command line buffer, the actual command line begins. That leaves a
total of 204 bytes for the complete command line.
However, the DOS read-line function does not provide a null-terminated
string as required by the command processor. It indicates the length of the
command string by the length byte described above. The command processor
uses that value to figure out where the terminating null (binary zero byte)
should be placed and puts it there. Thus there are only 203 character
positions available to the DOS read-line function, and this is the correct
value to use for Z3CLS. The general rule is that Z3CLS should be assigned a
value that is five less than the total size of the multiple command line
module.