SID/ZSID/DDT Console Redirection Patch SID2TTY is a small, public-domain program that dynamically patches the SID debugger (Data Resources, Inc.) to redirect all of SID's console input and output to the logical TTY: device. (ZSID2TTY and DDT2TTY are the ZSID and DDT versions.) By using a second terminal as the TTY: device to "command" SID, one can debug programs without interfering with standard console input and output. Thus, (assuming the usual CON:=CRT: assignment) a program's standard output will appear on the video monitor exactly as if the debugger were not in use, and program input will be entered on the standard keyboard. The patch itself is just 23 bytes -- it changes the IOBYTE each time SID calls for bdos console i/o service and restores it afterwards. The patch is relocated to protected high memory, below SID (and below any .SYM and .UTL files, which should be loaded first). Source file: SID2TTY.ASM for assembly with ASM or MAC. The ZSID and DDT versions are obtained by changing three equates. Requirements: CP/M 2.2 - 3.0 with IOBYTE implemented in bios. 8080, 8085 or Z80 CPU. SID v. 1.4 or ZSID v. 1.4 or DDT v2.2. External terminal connected to TTY: Installation: Set the equates for SID, ZSID or DDT. If your TTY: device needs initialization or de-initialization, insert the code in place of dummy routines. Bugs: Exiting from SID with ^C leaves the console redirected to TTY: (unless the BIOS improperly restores the IOBYTE on warmboots). The recommended fix is simply to exit with a "G0". Should you happen to hit ^C, reload SID and reset the IOBYTE to its original value, then exit with ^C from the CRT terminal. Remarks: 1. Although it would be possible to trap the warmboot and restore the IOBYTE, it's difficult to do correctly. Trapping 0001h violates the basic CP/M addressing convention, making it impossible to run other resident modules that need to locate the BIOS and BDOS. Trapping the warmboot at the BIOS jump vector does preserve addressing, but it still requires special efforts to maintain compatibility with any higher resident modules, and the trap must remove itself without disturbing them. Since the application here is manual, interactive debugging, it seems best to favor compatibility and do a manual restoration. 2. The assembler portion of SID/ZSID can be removed with the "-A" command to gain 680h bytes, but this must be done BEFORE loading SID2TTY. Version: 1.0 -- 10 October 1984 B. Mitchell Revisions: Please forward any revisions and improvements to the author. Author: Bridger Mitchell Plu*Perfect Systems Box 1494, Idyllwild CA 92349 (714) 659-4432 Note: Not tested on CP/M 3.0.