,ce
A DESCRIPTOR FOR THE TARGET/HOST LINK

The first step is to provide a device descriptor for the host system
to use to communicate with the target. This can easily be made using
the existing descriptor for that serial port. Lets assume that the
serial port you want to you use on the host already has a device
descriptor of "/t2", possibly the same one as you used to communicate
with your EPROM programmer. What we want is the same descriptor, but with
no line editing. Copy the t2 descriptor from your module directory using
the save command or from your disk and call it something else, such
as "td" for target debugger. To make this into a descriptor we can use,
we make use of the patch utility.
,pg 9

,nj
$ patch td
OmegaSoft 68000 Patch utility version 1.xx
Copyright 1986 by Certified Software Corporation
->m f                          {get module name offset}
0000000F 000F  70 /            {it is $70}
->m 70                         {use value from loc. $F}
00000070 0070  74 't           {change first letter to t}
00000071 0071  31 'd           {change second letter to d}
00000072 0072  00 /            {must terminate with zero}
->i 49 52 0                    {clear out line editing}
->i 54 5b 0                    {clear out more line editing}
->v                            {re-validate crc}
->q                            {quit}

,ju
You now have a device descriptor to talk to the host. Load the
descriptor and initialize it (iniz).

,bd
,ce
ATTEMPTING HOST <-> TARGET COMMUNICATION

The next step is to connect the necessary cables between the
serial port on the target and the serial port on the host.
After this is done, type the following command line :

$ tdb -p="/td"
,br

It should give you a sign-on and then report that it has
made communcation with the target through /td. It will also
display the limits of target RAM, and where the vectors are located.
Type Q and a carriage return to exit the target debugger.

,bd
,ce
TARGET DEBUGGER OPERATION

,bd
TARGET DEBUGGER COMMAND LINE

,bd
db [-options] [command file]

If any options are specified there must be no characters between
options (such as spaces or commas). The following options are valid :

,in 5
,si -5
n - set terminal number, default is auto-search if not specified, If this
format is used it must be the first option.

,si -5
Tn - set terminal number, default is auto-search if not specified.

,si -5
Dnnn - data size in K bytes - overrides default which is a percentage
of total size. Maximum is 31K, if zero is entered then 256 bytes are
used. This area holds the user's data section constants and variables.
Any excess space is allocated to the user's stack.
,br
,in 0
,pg

,in 5
,si -5
Ennn - externals table size in K bytes - overrides default which is
percentage of total size. This area holds user's external/entry
variables and procedures. This are also holds internal labels used to
access string and set costants - but this space is recycled after
each module is loaded.

,si -5
Mnnn - macro buffer area size in K bytes - overrides default which
is 1000 bytes. Holds macro definitions.

,si -5
Znnn - total data area size in K bytes - overrides default in
module header. The total size is divided into the debugger
symbol table and Externals/ESD tables.

,si -5
I - toggle initialize option : if enabled will clear out the
target system memory after communications is established. This is
needed when the target system uses parity.

,si -5
P[=]"port" - use other than default port - sets the port name
to be used for the communication with the target.
,br
,in 0

The defaults for various parameters are located near the
beginning of the program's data section and can be patched if
desired. The location given is the offset from the start of
the data section, this address can be obtained from locations
$48 through $4B of the current revision software.

,nj
Location      Meaning                    Default

0008          Directory of TCON file     4,'/dd/'
0030          Exception trap enable      1 (on)
0032          Version number of ICODE    '0D'
0034          Default communication port 4,'/frc'
004A          Link retry delay           500 (decimal)
004C          Default I option           0 (off)

,ju
The first three items are the same as for the host debugger. The
Default communication port is the path that will be used to
communicate with the target if the target debugger command
line P option is not used. The link retry delay is a timeout
counter that is used when the host expects a response from the
target before re-sending the last command.

For the last entry, only 0 (off) and 1 (on) are valid. If you set
the default I flag on and use the command line option, it will
be turned off.
,br
,pg

,bd
,ce
CONTROL E OPERATION

Use of control E (or control C) will first attempt to either:
,br
,in 3
,si -3
1) Set the "break" function true in the user's program if this
feature has been enabled by the user program, or
,si -3
2) Stop the
user's program at the start of the next statement, If this is sucessful,
then the abort will be recoverable, you can proceed from that point.
,br
,in 0

If the above were not sucessful, then enter control E again,
this will attemp
to stop the user's program immediately, if this is sucessful, then the
abort will be non-recoverable, you will not be able to proceed, you
would have to re-start the user program using the GO command. If this
is not sucessful, then enter control E again, this will attemp
to stop the host part of the debugger, if this is sucessful, then
the abort will be non-recoverable, and you will need to reset the
target system. If that is not sucessful, then the only course of
action available is to reset both the host and target systems.