                                ABSTRACT

PCDT is a program that lives in an 8K x 8 EPROM that is installed in a PC-XT
or equivalent in place of the normal boot ROM.  The program includes a col-
lection of diagnostic and debug utilities that a service technician might
find useful, especially in the case of a broken machine.  For the most part,
PCDT uses no RAM.  It communicates with a 9600 baud terminal on the special
supplied serial port.

There is also a slightly different version, PCDT.EXE, that can be run under
MS-DOS, posing as a normal program.

Commands are single letters of the alphabet.  Most act immediately without a
confirming CR.  Commands that prompt for hex input do require a CR, as well
as those with drastic effects.  In general, the ESC key is used to terminate
and/or abort commands.


                                COMMAND SUMMARY

A - Set address (variables A and B both set)
B - Back to previous address (set A = B)
C - Configure (4 subcommands)
        R - refresh started
        N - no refresh
        T - turbo speed
        S - standard speed
D - Dump memory, 16 bytes at S:A, A bumped
E - Exit to DOS if .EXE version. Restart if PROM version.
F - Fill memory, 64K seg S, prompted for word value
G - Go far [S:A] (puts S:A into SS:SP and does far RET)
H - Help (prompted for one of three screens)
I - In from port P and type value
J - Jump to S:A (requires confirming CR)
K - Keyboard test (the PC keyboard)
L - Loops for Techs with scopes (3 subcommands)
        I - Loops doing input from port P
        O - Loops doing output to port P, cycling value
        M - Memory stores and reads at S:A, cycling value
M - Modify memory byte-by-byte, ESC to quit
N - Noisemaker
O - Output to port P, prompts for value
P - Port set, prompts for port address
Q - nop
R - Reset -- test parity flag and reset it if set
S - Segment set, prompts for segment address
T - Test memory at S:A, 16K if main mem, 4K if hi mem
U - Floppy functions (4 subcommands)
        D - select another drive
        S - seek (good for alligning drives)
        B - read boot sector to boot address
        R - read other sector to other address
V - Video: fire up MDA and CGA, incrementing char codes
W - What memory?  Scans for presence of RAM, ROM, etc.
X - Xfer from smart terminal (4 subcommands)
        N - set number of bytes per block, prompts for n
        T - transfer block from terminal to S:A
        F - fill a block, prompts for hex value
Y - Ynterrupt exerciser
        C - Clock interrupt (timer)
        F - Floppy controller board
        K - Keyboard
Z - nop


                            COMMAND DETAILS

G - The Go command is provided as an alternative to the Jump command (see
    "J" below) for those applications that have a problem with either the
    location or the size of the J's stack/data area.  To use G the user
    first creates a stack area and fills it with a return address.  For
    example, to go to some code at 1234:0240 the user might input
        Segment set to :1234
        Address set to :0500    (stack higher in same segment)
        Modify memory to 40 (CR) 02 (CR) 34 (CR) 12 (CR) (ESC)
        Back to address 0500
        Go to 1234:0240 (CR)  (Note G tells where it's going, you confirm)

J - Because there is no way of jumping to an arbitrary 20-bit destination
    without using some RAM, a combined data and stack area is set up at
    000C0 - 000CC.  The jumped-to program may return with either a far
    return (code CB) or an INT 31 (code CD 31).  The program may use INT
    32 (code CD 32) to test for a keystroke (on the command terminal, not
    the PC keyboard); INT 32 returns control to PCDT if a key has been hit,
    but returns to the calling program otherwise.

K - Resets the PC keyboard (this should squeeze an AA out of it).  Then it
    stays in a loop displaying hex codes for keys depressed and released
    until any key is hit on the terminal keyboard.

L - A reasonable sync for all three loops is the I/O read to the serial
    port that checks for an abort keystroke.

N - The first two tones are tests of the gate and data functions.  The last
    tone is processor-timed; a keen ear can tell processor speed and how much
    processor time is being lost to refresh.

X - The X tries to be nice to the smart terminal.  It never sends an ASCII
    character that's too unusual.  The subcommand prompt is always a tilde
    and the hex input prompt is always a colon.  This means that a subroutine
    can be written to wait for the appropriate prompt, throwing out every-
    thing that does not match.  Transmission from the smart terminal to
    PCDT does, of course, somtimes involve arbitrary 8-bit data patterns,
    so the terminal should be set up for 8 bits, no parity, 2 stops.

Y - In order for interrupts to work properly there must be working RAM in
    the range 0:0000-0420 for interrupt vectors and a small stack.  The loop
    that waits for an operator's ESC refreshes memory in software.  Unused
    vectors point to a routine that types out 'Bad Interrupt'.



                       X COMMAND IN DETAIL

On receipt of the X command, PCDT enters the transfer submode,
where the prompt is a TILDE, and where there are five transcommands
interpreted as follows:

Transcommand:   T
Function:       Transfer a block to S:A, A += n;
Operands:       A block of n bytes (default 16)
Returned:       Checksum as two ASCII characters,
                CR,LF,TILDE

Transcommand:   N
Function:       Set n, the block size
Operands:       Size byte (00h interpreted as 256 bytes)
Returned:       CR,LF,TILDE

Transcommand:   F
Function:       Block fill n bytes at S:A, A += n;
Operands:       Value byte to use as sanitary fill
Returned:       Value byte as two ASCII characters,
                CR,LF,TILDE

Transcommand:   ESC
Function:       Exit the transfer submode
Operands:       none
Returned:       CR,LF,main prompt

Transcommand:   any other character, especially CR
Function:       ignored
Operands:       none
Returned:       CR,LF,TILDE



                       SERIAL COMMUNICATIONS SERVICES

These service routines provide support for the non-standard serial port
used in the PCDT environment.  PCDT does not use them.  PCDT runs with-
out a stack (or any RAM).

The services are much the same as those found in the 'ROM BIOS' of an
IBM PC or its clones, for which reference information is readily avail-
able*.  The following differences exist:
  1. Entry is not with an INT 14h but with a far call to FE00:FFFD.
     (The last three bytes of the PCDT ROM contain a 3-byte jump
     to the actual communications code which does an intersegment
     RET when done.)
  2. (DX) is ignored, there is just the one serial port.
  3. There are no implicit parameters in RAM.  The port addresses are
     assembled in.  The timeout is fixed at about 15 seconds for a
     machine with a standard 4.77 clock.

Calling conventions, registers on entry:
    (AH) specifies the command (service), of which there are four
    (AL) contains parameters/data for services 0/1
    (others) are preserved
Calling conventions, registers on return:
    (AH) returns line status 
    (AL) returns data (service 2) or modem status (services 0,3)
    (AL) is preserved (service 1)

The four services are summarized on the following page.

* Suggested references
1. IBM Corporation pub 6322508 "Technical Reference, Personal Computer XT
and Portable Personal Computer"
2. Norton, Peter "Programmer's Guide to the IBM PC", Microsoft Press.


Service (AH)=0 -- Initialize the serial port according to (AL)
 bits   765 - baud rt   43 - parity     2 - stops   10 - data bits
        -------------   -----------     ---------   --------------
        000 - 110       x0 - none       0 - 1       10 - 7 bits
        001 - 150       01 - odd        1 - 2       11 - 8 bits
        010 - 300       11 - even
        011 - 600
        100 - 1200
        101 - 2400
        110 - 4800
        111 - 9600

    On return (AH),(AL) are line,modem status as in serv (AH)=3 below.
    Note that PCDT initializes the port to something comperable to
    11100111 -- 9600 baud, no parity, 8 data bits, 2 stop bits.

Service (AH)=1 -- Send a serial output character from (AL)
    Assert DTR, RTS.  Wait for DSR || CTS.  Wait for TxRDY.  Send.
    On return (AL) is preserved, (AH) has two forms:
        1xxxxxxx - timeout error
        0sssssss - line status (see below)

Service (AH)=2 -- Receive a serial input character into (AL)
    Assert DTR.  Wait for DSR. Wait for RxRDY.  Read.
    On return char is in (AL), (AH) has two forms:
        10000000 - timeout error
        0sssssss - line status (see below)

Service (AH)=3 -- Interrogate serial port status
    Read Line Status into (AH) as follows
        0....... - (distinguishes line status from timeout)
        .s...... - Tx Shift reg empty
        ..s..... - Tx Holding reg empty (TxRDY)
        ...s.... - Break detect
        ....s... - Framing error
        .....s.. - Parity error
        ......s. - Overrun error
        .......s - RxReady

    Read Modem Status into (AL) as follows
        s....... - Carrier present
        .s...... - Ring indicator
        ..s..... - Data set ready (DSR)
        ...s.... - Clear to send (CTS)
        ....s... - Carrier status changed
        .....s.. - Ring status went false
        ......s. - CTS status changed



                                 TERM.EXE

This is a simple terminal program to be used when using a Computer as the
terminal.  It talks directly to the com1: port address (3f8 hex) for charactor
input and output to allow the use of a simple cable.  It is suggested that a
better terminal program be used.  A couple suggestions would be PROCOMM or 
QMODEM.

The special supplied serial interface board has been modified to allow the use
of a straight thru cable between it and the terminal or computer.  You should
only need to connect up pins 2,3 and 7.  A standard IBM serial interface cable
with a gender changer works great.

It is suggested that you place the PCDT rom into a 28 pin socket and then plug
the socket into the board under test.  This way if any pins get bent or broken
it is a simple matter of replacing the socket to repair the problem.  Blown or
broken PCDT proms will be replaced at a cost of $15.00.  An adaptor socket to
allow PCDT to be used in IBM PC's and XT's special 24 pin sockets is available 
for $40.00.  A version of PCDT in two proms (EVEN and ODD) for use in 8086 or
80286 machines is also available.  The cost for the PCDT-16 rom set is $40.00.

If you have any questions, comments or suggestions reguarding PCDT please give
us a call.

Fischer Computer Systems
445 Bay Street
Angwin, CA 94508
(707) 965-2414









