DESPOOL Background Print Utility Operator's Guide

Copyright (c) 1979
Digital Research

1. General.

Most large computer systems perform a function called printer "spooling" where
printer output is directed to a disk file rather than the physical printer,
leading to the notion that the stream of output characters is wound around a
spool. The spooled printer files are then written to the physical printer
device at a later time in "background mode" while the computer is performing
some other function. This background print function can be thought of as the
converse of spooling, resulting in a "despooling" function.

In the CP/M environment, it is often useful to have a background printing
facility, especially when operating with a low speed printer device, since the
time required to print listings or documents may be inordinately high. In
Particular, the "dead time" which occurs while the central computer waits for
console input provides an opportunity for background operations since printing
during this interval does not affect the throughput of the processor.

The CP/M DESPOOL utility is a program specially designed for operation with
CP/M Versions 1.4 and 2.2, and provides a background printing facility. When
DESPOOL is active, the operator can cause a disk file to be printed during the
inactive time that CP/M is waiting for console input. Thus, backqround
printing can take place during normal interactive CP/M operations such as
program editing and data entry under ED, or test program debugging using SID
or DOT.

Due to the fact that the console command pr-ocessor (CCP) is retained in
memory whenever OESPOOL is active, there is a minimum requirement of 18K of
main memory for proper operation.

2.		Activating DESPOOL.

The		despooling program is started by typing

DESPOOL cr

at the CCIP command level, where cr denotes the carriage return key. The
DESPOOL program loads, begins execution with the sign-on message

** DESPOOLER READY, TYPE CTL-F

and returns to the		CCP for subsecuent input c,ommands.	At
this		point,	the	DESPOOL 	program is active in memory, and


will remain active until removed by a CP/M cold start, or
ctl-B, as described below.

	If		the operator attempts to restart the DESPOOL
	program when it. is already active, the message

DESPOOL ALREADY PRESENT, TYPE CTL-F

will appear at the console.

	Following the initial DESPOOL siqn-on messaget the
	operator may proceed with the' usual CP/14 interac t 4 on,
	including DIR, ERA, TYPE, and SAVE commands. Further, the
	operator can initiate a transient program such as ED, DDT,
	PIP, or a user-defined program without affecting the
	operation of DESPOOL. Valid activations are:

DESPOOL cr
B:DESPOOL cr
d:despool cr

where, again, cr denotes the carriage return key.

3.		Printing a File.

	When DESPOOL is properly activated, as described
	above, the operator can cause DESPOOL to print a disk file
	by first typing ctl-F (control and F keys, simultaneously),
	w~ich acts as an attention mechanism, whenever CP/14'is
	reading a console character for the CCP or a transient
	prog ram. Wh e n ctl-F is typed, DESPOOL responds with the
	prompt:

PR T NT FILE:
~		J.

indicating that DESPOOL is ready to accept the name of a
file to print. Note that if DESPOOL is already printing a
file, then the current printing operation is discontinued.

	The operator then enters a file name using the normal
	CCP line editinq functions (see the manual "CP/M Features
	and Facilities" for line editing functions). For example,
	the input:

PRINT FILE: X.PRN cr

causes DESPOOL to print X.PRN from the currently logged disk
in background mode. If the file does not exist, or is an
ambiguous reference, the message:

NO PRINT FILE

is displaved at the console. If the file is oresent, the
backqroun~ print process commences. In either 'case, DESPOOL
does not retain console control, but instead allows control

2
to return normal input mode for the program which was
interrupted by the ctl-F key.

	Note that the file named above can be preceded by a
	drive name in order to override the default drive. T~us,
	the following are all valid input file names:

B:GAMMA.ASM
d:delta.dat
X.y
a:X.Y

Note that once that a background print operation begins, the
operator may change the default drive without affecting the
source drive specified in the DESPOOL input file name.

	The following point must be emphasized: the' initial
	prompt given by the interrupted program cannot be reissued
	by OESPOOL following file name input. The following
	sequence might occur, for example:

A>despool cr	(start the despooler)
** DESPOOLER READY, TYPE CTL-F
A>-F	(get despooler's attention)
** PRINT FILE:X.Y cr		(input file name)
cr	(single cr gets another 30)
A>

which starts the background print operation for X.Y, and
returns the cursor to the left for more CCP input commands.
Note that in this particular case, the CCP prompt is
recovered by simply typing an additional carriage return, as
denoted by the cr above.

	As a final note, you must take care not to erase a
	file which is currently being printed by DESPOOL. Although
	such action will not destroy the integrity of your data
	files, the erase command releases data storage areas which
	could be reallocated during the printing process, resulting
	in improperly printed data.

4.		Warm Starts.

	A normal warm start of the CP/M system, caused by
	typing ctl-C or at the termination of a transient program
does not deactivate DESPOOL. Thus, if a file is being
printed while an edit session is in progress, for example,
the edit can be terminated without aborting the print
process. As noted above, however, cold starts reload the
entire CP/M system, and thus cause any background printing
to be discontinued.

5.		Deactivating DESPOOL.

DESPOOL is deactivated		and removed from memory by
	3
typing cltl-B (control and B keys, simultaneously) when in
command i,nput mode. The ctl-B "boot" operation acts like
the normal ctl-C warm start function when CP/M is operating
without DESPOOL. Note that unlike the ctl-F attention key,
ctl-B can only be issued in command line input mode, similar
to ctl-C under normal CP/M operation. Further, the ctl-B
key must be the first key typed in the command line. These
restrictions are present to reduce chances of accidental
ctl-B input during command or data entry. Thus, for
example, ctl-B can be entered during editing immediately
following the standard "" ED prompt, while the ctl-B is
ignored when typing characters in input mode using the I
command.

6.		Implementation Notes.

	The DESPOOL utility is a self-relocating program,
	similar to DOT and SID. Upon initial startup, DE9POOL is
	loaded into the base of the Transient Program Area where it
	receives control from the CCP. The DESPOOL program is then
	moved into high memory, directly below the CCP where it
	resides' during the time it is active. The memory image
	during DESPOOL operation in a 32K 1.4 CP/M system, for
	exami:).1e, appears as follows:
8000H: -------------------
	BIOS
7EOOH:

BOOS

710OH: --------------------

C __P

690OH: -------------------
670OH:	PSEUDO BIOS
			DESPOOL
		JMP BOOS
6303H: -------------------
				TPA
010OH: -------------------
0005H:	JMP 6503H
	JMP 6703H
OOOOH:

The normal BOOS jump address at location 0005H is changed to
reflect the reduced amount of f ree memory (0100H through
630Zi in the example given above). Thus, programs such as
ED, DOT, PIP, and similarly written user programs which
14size" memory using the BOOS jump address will operate
properly when DESPOOL is active. Due to the fact that
DESPOC L deaends upon physical contiquity with t In e CC?
module, it cannot be operated under DDT or SID (althouqh DOT
or SID can operate under DESPOOL).

4
	The PSEUDO BIOS portion of the memory image contains a
	slightly altered version of the jump vector normally
	contained at the beginning of the BIOS. The jump vector is
	aligned on an even page boundary, so that it appears
	programmatically similar to the jump vector in high memory.
	The jump instruction at location OOOOH is altered to address
	this pseudo jump vector in order to accommodate programs
	which directly access the BIOS without calling the CP/M
	BDOS. Although there are no Digital Research programs which
	directlv access the BIOS, there are CP/M compatible language
	processors, such as Microsoft and Tarbell BASIC, which
	obtain their console characters directly through the BIOS.
	Given that a particular program locates the BIOS jump vector
	though the address field of the jump at OOOOH, it will
	operate properly under DESPOOL.

	The jump addresses remain intact upon warm start using
	ctl-C, but are replaced with their original values when
	ctl-B is processed.

7.		Improving DESPOOL Response.

	The DESPOOL program operates by sampling console
	status while printing a file in backqround mode. If no
	console input is ready, then the DESPOOL program prints the
	next output character. Due to the nature of some Printer
	devices, this can cause a somewhat "sluggish" response to
	console input characters. In order to alleviate t-his
	condition, DESPOOL can be altered in the field to sample the
	printer status as well as the console status. In this case,
	printer output characters will not be sent until DESPOOL has
	sampled the printer status and found that the Printer is
	ready to accept another character. When modified in this
	manner, the onlv delays which will be encountered at the
	keyboard will be during disk accesses.

	The printer status chanqe is accomplished as follows.
	Write a subroutine in your BIOS (if it is not already there)
	which interrogates the printer status and returns one of two
conditions in register A:
	A = 00	indicates that the printer is not
		ready to accept an output character
	A = FF	indicates that the printer is ready
		to accept an output character (any
		non-zero value is treated as FF).

Assume that this subroutine is called PRSTAT, for "printer
status." Augment the normal jump vector at the beginning of
your BIOS to include a vectored jump to the PRSTAT
subroutine, and include this jump at the end of the list
given in the Digital Research manual entitled "CP/M System
Alteration Guide," resulting in a jump vector which appears
as shown below:

5
imp		BOOT	;COLD BOOT ENTRY
imp		WBOOT	;WARM BOOT ENTRY
imp		CONST	;CONSOLE STATUS
imp		CONIN	;CONSOLE INPUT
imp		CONOUT	;CONSOLE OUTPUT
imp		LIST	;LIST OUTPUT
imp		PUNCH	;PUNCH OUTPUT
imp		READER	;READER INPUT
imp		HOME	;HOME THE DISK
imp		SELDSK	;SELECT DISK DRIVE
imp		SETTRK	;SET TRACK NUMBER
imp		SETSEC	;SET SECTOR NUMBER
imp		SETDMA	;SET DMA ADCRESS
imp		READ	;READ SECTOR
imp		WRITE	;WRITE SECTOR
imp		PRSTAT	;SAMPLE PRINTER STATUS

The addition of the "JMP PRSTAT" element at the end of the
list results in a total of sixteen jump vectors elements in
the modified BIOS.

	Incorporate your modified BIOS into a test CP/LM system
	using the standard procedures given in the "CP/M System
	Alteration Guide." Cold start your test system, and load the
	DESPOOL program, usinq the special form:

DESPOOL *

where the ""		indicates that DESPOOL is to take	- Drinter
status		into	account.	If the 11" is not included, OESPCOL
assumes that printer status is not available, and will	not
oerform calls		on the sixteenth	jump vector element (JMP
PRSTAT, above) .

	Once you have completed your tests, you may make a
	permanent change to the DESPOOL memory image using DOT so
	that it is not necessary to type the "" character each time
	you start the DESPOOL program. The change is made by
	loading the DESPOOL program into the DOT test program area,
	altering a "printer status available" flag, followed by a
	SAVE operation which records the altered memory image. The
	iorocedure is shown below:

DOT DESPOOL.COM cr		Load DESPOOL under DDT
NEXT	PC
OBOO	0100	Response from DDT
S206 cr	Set memory at 0206H
0206 00 01 cr	Change flag 00 to 01
0207 cr	Stop "S" mode
GO cr	Go to OOOOH (warm start)
SAVE 10 UNSPOOL.COM cr		Record altered program

At this point, you have a test version of DESPOOL, called
UNSPOOL, which has an assumed "*" input parameter each time
it is ocerated. Test the new UNSPOOL and, when satisfied

6
that it operates in the same manner as DESPOOL with the "*"
parameter, propAqate this new program throughout your disks
which contain the altered BIOS described above.

7
