home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / debug / tt_cdeb / ttcd.doc < prev    next >
Encoding:
Text File  |  1987-11-14  |  99.5 KB  |  3,103 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.        
  8.        
  9.                                      T T C D
  10.                                      -------
  11.        
  12.                              (The Turbo C Debugger)
  13.                               --- ----- - --------
  14.        
  15.        
  16.                                    USERS GUIDE
  17.        
  18.        
  19.                                    Version 1.5
  20.        
  21.        
  22.        
  23.        
  24.        
  25.        
  26.        
  27.        
  28.        
  29.        
  30.        
  31.        
  32.        
  33.        
  34.        
  35.        
  36.        
  37.        
  38.        
  39.                                (C) COPYRIGHT 1987
  40.                                        by
  41.                                   SAYSoft, Inc.
  42.                                ALL RIGHTS RESERVED
  43.        
  44.        
  45.                                      Created
  46.                                        by
  47.        
  48.                                    Steve York
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.        
  74.        
  75.                                 COPYRIGHT NOTICE
  76.        
  77.        The Turbo C Debugger (TTCD) program and documentation is the
  78.        copyrighted property of SAYSoft, Inc.  You are granted a limited
  79.        license to use the limited version of TTCD, and to copy it and
  80.        distribute it, provided that the following conditions are met:
  81.        
  82.        1)  No fee may be charged for such copying or distribution.
  83.        
  84.        2)  TTCD may ONLY be distributed in its original, unmodified form.
  85.        
  86.        3)  TTCD may not be distributed, in whole or in part, as part of
  87.            any commercial product or service without the express written
  88.            permission of SAYSoft, Inc.
  89.        
  90.        
  91.                                   USER LICENSE
  92.        
  93.        The limited version of TTCD along with this documentation may be
  94.        freely copied to any person or organization in unmodified form.  It
  95.        may not be distributed in modified form, and may not be sold for
  96.        profit.
  97.        
  98.        THE FULL VERSION OF TTCD (AND ITS DOCUMENTATION) MAY NOT BE
  99.        DISTRIBUTED OR DUPLICATED IN ANY FORM EXCEPT FOR PERSONAL ARCHIVAL
  100.        PURPOSES.
  101.        
  102.        
  103.                                    DISCLAIMER
  104.        
  105.        SAYSoft, Inc. will not be liable for any damages or claims related
  106.        in any way to the use of this product.  SAYSoft, Inc. makes no
  107.        warranties and specifically disclaims any implied warranties of
  108.        this product.
  109.        
  110.        
  111.        
  112.        
  113.        
  114.        
  115.        
  116.        
  117.        
  118.        
  119.        
  120.        
  121.        
  122.        
  123.        
  124.        
  125.        "Turbo C" and "Turbo Pascal" are trademarks and products of Borland
  126.        International, Inc.
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.                                             
  140.                                The Limited Version
  141.                                      of TTCD
  142.        
  143.        
  144.        Since only a very small percentage of "Shareware" program users
  145.        actually send the requested money to the program author I decided
  146.        to try the "limited version" approach.  Consequently, there are two
  147.        versions of TTCD.  A limited version, and a full version.
  148.        
  149.        *******************************************************************
  150.            IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
  151.        *******************************************************************
  152.        
  153.        The limited version of TTCD is identical to the full version,
  154.        except for the following limitations:
  155.        
  156.            o  Only "small" model programs can be debugged.
  157.            
  158.            o  It does not support programs that use CGA or EGA graphics.
  159.            
  160.            o  Only 300 global symbols are allowed.
  161.            
  162.        *******************************************************************
  163.        
  164.        
  165.        Contributions for the use of TTCD will be appreciated, and should
  166.        be sent to:
  167.        
  168.            SAYSoft, Inc.
  169.            14938 Kimberley
  170.            Houston, TX 77079
  171.        
  172.        If you would like to purchase the full version, please send $25.00
  173.        to the above address.  Include sales tax if you are a Texas
  174.        resident.
  175.        
  176.        With the full version, you will receive a printed and bound manual,
  177.        a program serial number, and a telephone number for support.
  178.        
  179.        Registered full version TTCD users will be able to download
  180.        upgrades, at no charge (except the cost of the phone call), as they
  181.        become available.
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                Table of Contents
  203.                                        
  204.                                        
  205.        1.0  About TTCD...............................................1
  206.            1.1  Background...........................................1
  207.            1.2  What is TTCD?........................................1
  208.            1.3  Files included with TTCD.............................2
  209.            1.4  Limitations of this version of TTCD..................2
  210.            1.5  TTCD and Different Turbo C Versions..................3
  211.            1.6  Future Directions of TTCD............................3
  212.            
  213.        2.0  What is Required.........................................4
  214.            2.1  Hardware and software required.......................4
  215.            2.2  Compile and Link options and settings required.......4
  216.                2.2.1  Compile Options................................4
  217.                2.2.2  Link Options...................................5
  218.            2.3  Source code requirements.............................5
  219.            2.4  Related files........................................5
  220.            
  221.        3.0  Executing TTCD...........................................7
  222.            3.1  The TTCD Command Line................................7
  223.            3.2  The TTCD Startup Screen..............................8
  224.            3.3  Getting Started......................................9
  225.            
  226.        4.0  The TTCD Commands and Displays..........................10
  227.            4.1  The Status line.....................................10
  228.            4.2  The Main Menu.......................................10
  229.                4.2.1  <B>reakpoints.................................11
  230.                    4.2.1.1  <C>onditional...........................12
  231.                    4.2.1.2  <D>isplay...............................12
  232.                    4.2.1.3  <L>ine number...........................13
  233.                    4.2.1.4  <P>rocedure.............................13
  234.                    4.2.1.5  <R>eset.................................13
  235.                4.2.2  <C>alc........................................13
  236.                4.2.3  <D>isplay.....................................14
  237.                    4.2.3.1  <G>lobal symbol.........................14
  238.                    4.2.3.2  <M>emory................................14
  239.                    4.2.3.3  <P>ublics...............................15
  240.                    4.2.3.4  <R>egisters.............................15
  241.                    4.2.3.5  <S>tack.................................15
  242.                    4.2.3.6  Display 'Types'.........................16
  243.                    4.2.3.7  Valid TTCD Addresses....................17
  244.                    4.2.3.8  <D>isplay Command Examples..............18
  245.                4.2.4  <E>nter.......................................20
  246.                    4.2.4.1  <R>egister..............................20
  247.                    4.2.4.2  <M>emory................................20
  248.                4.2.5  <G>o..........................................21
  249.                    4.2.5.1  <F>orever...............................22
  250.                    4.2.5.2  <L>ine numbers..........................22
  251.                    4.2.5.3  <P>rocedure.............................22
  252.                4.2.6  <L>ist........................................22
  253.                4.2.7  <K>eep........................................22
  254.                    4.2.7.1  <D>elete................................23
  255.                    4.2.7.2  <G>lobal Symbol.........................23
  256.                    4.2.7.3  <M>emory................................23
  257.                    4.2.7.4  <R>egisters.............................23
  258.                4.2.8  <M>acros......................................24
  259.  
  260.  
  261.  
  262.                                         iii
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                Table of Contents
  269.                                        
  270.                                        
  271.                    4.2.8.1  <D>isplay...............................24
  272.                    4.2.8.2  <L>oad..................................24
  273.                    4.2.8.3  <R>ecord................................24
  274.                    4.2.8.4  <S>ave..................................25
  275.                4.2.9  <O>ptions.....................................25
  276.                    4.2.9.1  <A>nimation Breakpoints.................25
  277.                    4.2.9.2  <D>isplay...............................26
  278.                    4.2.9.3  <F>lip screen on trace..................26
  279.                    4.2.9.4  <S>now suppression......................26
  280.                4.2.10  <Q>uit.......................................26
  281.                4.2.11  <P>rint......................................27
  282.                4.2.12  <S>creen.....................................27
  283.                4.2.13  <T>race......................................27
  284.                    4.2.13.1 <A>nimate...............................27
  285.                    4.2.13.2 <S>ingle step...........................28
  286.                    4.2.13.3 <P>roc step.............................28
  287.                    4.2.13.4  Using <T>race..........................28
  288.                4.2.14  <U>nassemble.................................29
  289.            4.3  The Repeat Count....................................30
  290.            4.4  Program Termination.................................31
  291.            
  292.        5.0  Notes about Debugging with TTCD.........................32
  293.            5.1  Source Code Formatting..............................32
  294.            5.2  Mnemonic Differences................................32
  295.            5.3  Special Interrupts..................................33
  296.            5.4  Floating Point Emulation Deviations.................33
  297.            5.5  Floating Point Problems.............................33
  298.            5.6  Optimization Options................................34
  299.            5.7  The "#line" Directive...............................34
  300.            5.8  Memory Considerations...............................34
  301.            5.9  Interrupt Vector Trapping...........................35
  302.            5.10  Trapping Math Errors...............................35
  303.            
  304.        6.0  Input responses to TTCD prompts.........................37
  305.            6.1  Input field editing.................................37
  306.            6.2  Case sensitivity....................................37
  307.            6.3  Input Radix Defaults................................38
  308.            6.4  Address Specification Defaults......................38
  309.            
  310.        7.0  TTCD.MAC Format and Use.................................39
  311.        
  312.        8.0  Known TTCD Bugs and Anomalies...........................40
  313.        
  314.        9.0  Version Changes/Modification to TTCD....................41
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.                                         iv
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.        1.0  About TTCD
  338.        
  339.        
  340.        1.1  Background
  341.        
  342.        The Turbo C (tm) compiler is (for the most part) a very complete C
  343.        compiler.  It fully supports K & R definitions, has library
  344.        routines supporting nearly all applicable UNIX "standard C library"
  345.        calls, and supports most of the (proposed) ANSI C standard.
  346.        Moreover, like the ubiquitous Turbo Pascal (tm) it has several
  347.        useful (and high-powered) machine-/DOS-dependant language
  348.        extensions and library routines.
  349.        
  350.        As an advanced C programmer, the first thing I did with Turbo C was
  351.        to try to re-compile some of my previously written C programs with
  352.        it.  The C compiler that I have used for several years was not as
  353.        close to the "UNIX type" compiler, and did not attempt to emulate
  354.        the UNIX environment.  I quickly discovered that one thing I really
  355.        needed did not come with Turbo C.  A tool that no C programmer
  356.        should be without - a good debugger.  I presume that the people at
  357.        Borland expect Turbo C users to use the DOS "DEBUG" program, or
  358.        some equivalent product.
  359.        
  360.        
  361.        1.2  What is TTCD?
  362.        
  363.        TTCD is a symbolic source-level debugger for programs written in
  364.        Turbo C.
  365.        
  366.        TTCD allows debugging Turbo C programs via:
  367.        
  368.            o  Normal execution to any specified line, procedure, or user-
  369.               specified breakpoint(s).
  370.            
  371.            o  Single-stepping through execution.
  372.            
  373.            o  Program "animation".
  374.        
  375.        
  376.        TTCD supports:
  377.        
  378.            o  All Turbo C models except "Tiny".
  379.            
  380.            o  Real-time examination/modification of variables, memory, and
  381.               machine registers.
  382.            
  383.            o  Variable-speed animation.
  384.            
  385.            o  "Conditional" and "looping" breakpoints.
  386.            
  387.            o  "Sticky" and "Non-sticky" breakpoints.
  388.            
  389.            o  8087 code, or floating point emulation.
  390.            
  391.  
  392.  
  393.  
  394.        About TTCD                                                  Page 1
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.            o  Retaining variables, memory locations, or the machine
  404.               registers on the screen.
  405.            
  406.            o  Symbolic dis-assembly of program code.
  407.            
  408.            o  Key-macros.
  409.            
  410.            o  Programs that generate CGA and EGA graphics.
  411.            
  412.            o  Multiple source-module programs.
  413.            
  414.            o  80186/80286 instructions.
  415.        
  416.        
  417.        1.3  Files included with TTCD
  418.        
  419.        The files included with this release of TTCD and their descriptions
  420.        are:
  421.        
  422.            o  TTCD.EXE - This is the TTCD program.
  423.            
  424.            o  TTCD.DOC - Users guide for TTCD.
  425.            
  426.            o  TTCD.TC  - Sample Turbo C configuration file for use when
  427.               compiling a program to be debugged with TTCD.
  428.            
  429.            o  TTCD.MAC  - This is a sample TTCD macro file.  It contains
  430.               useful definitions for function keys <F7> thru <F0>.  Use
  431.               the <M>acro <D>isplay command, or MAC2TEXT to display the
  432.               recorded key strokes.
  433.            
  434.            o  MAC2TEXT.C  - This is the source code to a program that will
  435.               convert the TTCD.MAC macro file to readable text.  When
  436.               compiled, this program will allow you to view TTCD macros
  437.               that you have recorded and saved.
  438.            
  439.            o  COND.H  - This is an include file that will allow you to
  440.               easily set up conditional breakpoints (of any complexity) at
  441.               the source code level.
  442.        
  443.        
  444.        1.4  Limitations of this version of TTCD
  445.        
  446.        This version of TTCD has some limitations.  They are:
  447.        
  448.            o  "Tiny" model programs are not supported.
  449.            
  450.            o  Programs that use VGA Graphics are not supported.
  451.            
  452.            o  Maximum number of global symbols is 5000.
  453.            
  454.            o  Maximum number of modules is 30.
  455.            
  456.            o  Maximum number of lines per module is 65000.
  457.  
  458.  
  459.  
  460.        About TTCD                                                  Page 2
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.            
  470.            
  471.        1.5  TTCD and Different Turbo C Versions
  472.        
  473.        I have Turbo C version 1.0 dated 6/3/87.  All applicable Borland
  474.        patches (TCP1.DIF thru TCP9.DIF) have been applied to it.  TTCD was
  475.        created with this version of Turbo C, and all my testing was done
  476.        using programs compiled with this version of Turbo C.  Patched or
  477.        later versions may not have some of the problems discussed in
  478.        section 5 of this users guide.
  479.        
  480.        I fully expect TTCD to be compatible with future versions of Turbo
  481.        C unless radical changes are made in the product.  If a new version
  482.        of Turbo C is "TTCD incompatible", REGISTERED FULL VERSION TTCD
  483.        USERS WILL BE ABLE TO DOWNLOAD TTCD UPGRADES AT NO CHARGE (except
  484.        the cost of the phone call).
  485.        
  486.        For information about new versions of TTCD, or download
  487.        availability call Pat at (713) 487-8379.
  488.            
  489.            
  490.        1.6  Future Directions of TTCD
  491.        
  492.        In future releases of TTCD, I plan to support the following:
  493.        
  494.            o  Auto-configuration of global variable "types" for the
  495.               <D>isplay and <E>nter commands.
  496.            
  497.            o  Programs that generate VGA graphics (and possibly Hercules
  498.               graphics).
  499.            
  500.            o  Expanded memory use for graphics screen swapping and caching
  501.               of source code.
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.        About TTCD                                                  Page 3
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.        2.0  What is Required
  536.        
  537.        An understanding of how C utilizes memory is necessary for serious
  538.        C program writing, and useful for debugging any C program.  Also a
  539.        knowledge of 8086 Assembler is recommended.
  540.        
  541.        
  542.        2.1  Hardware and software required
  543.        
  544.        A fixed disk is recommended, but not required.  If a fixed disk is
  545.        not available, the use of a RAM disk or disk cache will minimize
  546.        the wait for source code to be displayed.
  547.        
  548.        The following hardware and software is required to make use of
  549.        TTCD:
  550.        
  551.            o  Version 1.0 (or greater) of Turbo C.
  552.            
  553.            o  Approximately 128K bytes + the memory required by the target
  554.               program.  In addition, about 12K more memory is required if
  555.               the "-C" command line option is used, and about 108K more if
  556.               the "-E" command line option is used.  See section 3.1 for
  557.               explanations of these options.
  558.            
  559.        
  560.        2.2  Compile and Link options and settings required
  561.        
  562.        
  563.        2.2.1  Compile Options
  564.        
  565.        To debug a Turbo C program with TTCD, the program must be compiled
  566.        with the following options set:
  567.        
  568.            o  "Model":                   Any model except "Tiny".
  569.               (NOTE: THE LIMITED VERSION OF TTCD WILL ONLY HANDLE "SMALL"
  570.               MODEL PROGRAMS.)
  571.            
  572.            o  "Calling convention":      "C".
  573.            
  574.            o  "Underbars":               On.
  575.            
  576.            o  The "Line numbers" option must be on for any modules that
  577.               you intend to "step through" or set breakpoints in.  The
  578.               module that contains 'main()' must be compiled with line
  579.               numbers on.
  580.        
  581.        The following option settings are recommended, but not required:
  582.        
  583.            o  "Standard Stack Frame":    On.
  584.        
  585.            o  "Use Register variables":  Off.
  586.        
  587.  
  588.  
  589.  
  590.  
  591.  
  592.        What is Required                                            Page 4
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.            o  "Register Optimization":   Off.
  602.        
  603.            o  "Jump Optimization":       Off.
  604.            
  605.        All other compile options may be set as desired.
  606.        
  607.        
  608.        2.2.2  Link Options
  609.        
  610.        To debug a Turbo C program with TTCD, the program must be linked
  611.        with the following options set:
  612.        
  613.            o  A "Map" file must be produced with either the "Publics" or
  614.               "Detailed" options on.  Preferably the "Publics" option, as
  615.               this is smaller, and faster to read.
  616.            
  617.            o  The "Class names" must not be changed for code, data, or
  618.               BSS.
  619.            
  620.        All other link options may be set as desired.
  621.        
  622.        
  623.        2.3  Source code requirements
  624.        
  625.        Any source modules that you intend to step through, or set
  626.        breakpoints in must be compiled with the "Line numbers" option on.
  627.        The default maximum number of modules compiled with line numbers is
  628.        10.  This may be changed via command line options.  See section
  629.        3.1.
  630.        
  631.        The source code for any module compiled with line numbers may be in
  632.        any drive/directory when executing TTCD.  If it is not found, you
  633.        will be prompted for the new path, when entered, debugging will
  634.        continue as usual.  If prompted for a new path, you must enter some
  635.        drive and/or path at this prompt, even to get to a source file in
  636.        the current directory.
  637.        
  638.        
  639.        2.4  Related files
  640.        
  641.        In order to debug a Turbo C program, TTCD needs quite a bit of
  642.        information about it.  This information is obtained from the .MAP
  643.        file produced by the linker.  For instance, to debug a program
  644.        named "HELLO.EXE", TTCD will also need "HELLO.MAP" (produced by the
  645.        linker) and "HELLO.C", the program source code.  If the program
  646.        consists of multiple source code modules, these files should also
  647.        be available to TTCD if compiled with line numbers.
  648.        
  649.        TTCD will read the .MAP and .EXE files and create a file with the
  650.        extension ".DBG".  The .DBG file is a relocatable program similar
  651.        to an .EXE file, but it will not execute properly outside of TTCD.
  652.        The .DBG file will be erased automatically, upon termination of
  653.        TTCD.
  654.        
  655.  
  656.  
  657.  
  658.        What is Required                                            Page 5
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.        NOTE: TTCD does not change the .EXE file.  If the program works
  668.        properly, it does not have to be re-compiled.
  669.        
  670.        Warning:  If any of the source code modules are changed, and not
  671.        re-compiled, the .EXE file (and consequently the .MAP and .DBG
  672.        files) may not reflect the correct line number or procedure
  673.        addresses.  This could create quite a bit of confusion during the
  674.        debugging process.
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.        What is Required                                            Page 6
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.        3.0  Executing TTCD
  734.        
  735.        
  736.        3.1  The TTCD Command Line
  737.        
  738.        The TTCD command line is as follows:
  739.        
  740.            TTCD [options] PROGRAM <program arguments & options>
  741.        
  742.        Where PROGRAM is the name of the .EXE file to debug (the "target"
  743.        program).  The extension need not be specified as it must be an
  744.        .EXE file.  The target program and its map file must be in the
  745.        current directory, on the current drive.
  746.        
  747.        The TTCD options are as follows:
  748.        
  749.        -C   (CGA Graphics option on)
  750.        
  751.            This option specifies that buffer space should be allocated for
  752.            storage of a 16K "program screen".  Note that the program is
  753.            not automatically put in any graphics mode if this is
  754.            specified.  Screen modes are still controlled by the target
  755.            program.  This option causes TTCD to use about 12K more memory.
  756.            THIS OPTION IS NOT AVAILABLE IN THE LIMITED VERSION OF TTCD.
  757.        
  758.        -E   (EGA Graphics option on)
  759.        
  760.            This option specifies that buffer space should be allocated for
  761.            storage of a 112K "program screen".  This option causes TTCD to
  762.            use about 108K more memory.  Screen swapping is much slower
  763.            when the target program is in any of the EGA graphics modes
  764.            than when in the text or CGA modes.  THIS OPTION IS NOT
  765.            AVAILABLE IN THE LIMITED VERSION OF TTCD.
  766.        
  767.        -S###   (Number of global symbols)
  768.        
  769.            This option specifies the size of the global symbol table.  The
  770.            default is 500 symbols (the limited version default is 300).
  771.            This option is for use with programs that have more than 500
  772.            symbols.  It may also be used to decrease the symbol table size
  773.            if the debugger runs out of memory.  THE LIMITED VERSION OF
  774.            TTCD SUPPORTS A MAXIMUM OF 300 SYMBOLS.  No white space is
  775.            allowed between the 'S' and the digits.
  776.        
  777.        -M##    (Number of modules with line numbers)
  778.        
  779.            This option specifies the size of the 'module table'.  The
  780.            default is 10 modules.  This option is for use with programs
  781.            that are broken into many small modules.  Only the number of
  782.            modules compiled with line numbers use module table space.
  783.            Modules that are compiled without line numbers do not need to
  784.            be included in the module count.  No white space is allowed
  785.            between the 'M' and the digits.
  786.        
  787.  
  788.  
  789.  
  790.        Executing TTCD                                              Page 7
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.        -B##    (Source file buffer size)
  800.        
  801.            This option specifies the size of the source file disk access
  802.            buffer.  The number specifies the buffer size in Kbytes.  The
  803.            minimum allowed is 4, and maximum allowed is 60.  The default
  804.            buffer size is 4K.  The size of the disk buffer can greatly
  805.            affect the speed of program animation.  If the buffer size
  806.            specified is larger than the largest source file, then program
  807.            animation can always be done with no disk reads to display
  808.            source code (within a single source module).  A large buffer
  809.            can slow down single step animation if the animation causes
  810.            excessive alternation of source modules.  Note that memory
  811.            allocated for the disk buffer is taken from the available
  812.            memory for the target program.  No white space is allowed
  813.            between the 'M' and the digits.
  814.        
  815.        
  816.        3.2  The TTCD Startup Screen
  817.        
  818.        When execution of TTCD starts, it will display status lines showing
  819.        that it is reading the map file, and generating the ".DBG" file.
  820.        
  821.        When the program variables and tables are set up, some status
  822.        information will be displayed.  This should look similar to the
  823.        following:
  824.        
  825.            TTCD  Version 1.0
  826.            Created by Steve York.
  827.            Copyright (c) 1987 by SAYSoft, Inc.
  828.            
  829.            Full version.
  830.            
  831.            Reading MCALC.MAP . . .
  832.            Creating MCALC.DBG . . .
  833.            
  834.            Map contains:
  835.              279/500 global symbols
  836.              6/10 module definition(s) with line numbers
  837.              1534 lines total
  838.            
  839.            24170 bytes free.
  840.            
  841.            Press <ESC> to abort, any other key to start.
  842.        
  843.        
  844.        This tells us:
  845.        
  846.            o  There are 279 global symbols in MCALC.  This includes
  847.               procedure names, global variables, procedure names linked in
  848.               from libraries, and the overhead generated by Turbo C.  The
  849.               symbol table size is set to 500 symbols (default table
  850.               size).
  851.            
  852.  
  853.  
  854.  
  855.  
  856.        Executing TTCD                                              Page 8
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.            o  There are 6 program modules compiled with the 'line numbers'
  866.               option on.  The module table is set to 10 modules.
  867.            
  868.            o  There are 1534 executable lines.  This is only a sum of the
  869.               lines in the modules compiled with line numbers.
  870.        
  871.            o  There are about 24K bytes of data space left for MCALC to
  872.               "grow", and still fit in TTCD with line numbers for all six
  873.               modules.  (Enough space for about 2000 more lines in modules
  874.               compiled with line numbers.)
  875.        
  876.        TTCD is "small" model program itself.  Consequently its own data
  877.        space is limited to 64K.  This is enough space for fairly large
  878.        target programs.  Programs of nearly any size can be debugged with
  879.        TTCD if only selected modules are compiled with numbers.
  880.        
  881.        
  882.        3.3  Getting Started
  883.        
  884.        TTCD has several commands and menus, however, it is relatively
  885.        straightforward to learn and use.  To become acquainted with TTCD,
  886.        it is a good idea to "step through" a working program before
  887.        actually using it to debug a program with problems.
  888.        
  889.        For a simple example, "MAC2TEXT" can be used to "test drive" TTCD.
  890.        MAC2TEXT.C is one of the files distributed with TTCD.  Its purpose
  891.        is to convert TTCD macros to readable text.
  892.        
  893.        For a more complete example, the "MCALC" program that comes with
  894.        Turbo C can be used to "test drive" TTCD.
  895.        
  896.        In either case, compile all source code modules with the "line
  897.        numbers" option on.  Set all other compile and link options as
  898.        described in section 2.2.
  899.        
  900.        When either MAC2TEXT.EXE or MCALC.EXE has been generated, enter (at
  901.        the DOS prompt) the corresponding command:
  902.        
  903.          TTCD MAC2TEXT
  904.        
  905.        or
  906.        
  907.          TTCD MCALC
  908.        
  909.        If the target program has been compiled correctly, the TTCD startup
  910.        screen will be displayed.  This will resemble the example shown in
  911.        section 3.2.  Press any key (except <ESC>) to go to the TTCD main
  912.        menu.
  913.        
  914.        At this point, try each of the commands described in section 4.2 to
  915.        become familiar with them, and how they are used.
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.        Executing TTCD                                              Page 9
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.        4.0  The TTCD Commands and Displays
  932.        
  933.        Menus and prompts in TTCD are always on the top line of the screen.
  934.        Menu options are selected by pressing the first letter of the
  935.        command.  The <ESC> key will always exit a menu with no action, and
  936.        return to the Main menu.
  937.        
  938.        The second line of the screen is a status line.  The rest of the
  939.        screen is used to show source lines, variable, memory and register
  940.        values, and other information.
  941.        
  942.        
  943.        4.1  The Status line
  944.        
  945.        The second line of the screen is the status line.  It displays the
  946.        current module name, procedure/function name, and source line
  947.        number within that module.  For instance, the top two lines of the
  948.        screen may look like:
  949.        
  950.            <SPACE> - Menu 2    <B>reakpoints   <C>alc   <D>isplay   <E>...
  951.            =========  Module: HELLO.C    Proc: main()    Line: 16 =====...
  952.        
  953.        The status line tells us:
  954.        
  955.            o  We are in a source code module named "HELLO.C".
  956.            
  957.            o  We are in procedure "main".
  958.            
  959.            o  The next line to execute is source line number 16.
  960.        
  961.        The left end of the status line also shows other information.  If a
  962.        macro-recording is in progress, the leftmost column will have an
  963.        'R'.  If the <P>rint command is active, the second column will have
  964.        a 'P'.  If the repeat count value (see section 4.3) is greater than
  965.        zero, its value is displayed near the left end.
  966.        
  967.        
  968.        4.2  The Main Menu
  969.        
  970.        The "Main menu" actually consists of three lines, only one of which
  971.        is displayed at a time.  The <SPACE> key changes the displayed
  972.        line.  The three lines are:
  973.        
  974.            <SPACE> - Menu 2  <B>reakpoints  <C>alc  <D>isplay  <E>nter
  975.            <G>o
  976.            
  977.            <SPACE> - Menu 3  <K>eep  <L>ist  <M>acro  <O>ptions  <P>rint
  978.            <Q>uit
  979.            
  980.            <SPACE> - Menu 1  <S>creen  <T>race  <U>nassemble
  981.            
  982.        Options are selected by pressing the letter in the angle-brackets.
  983.        The space bar simply toggles the display of these three lines, any
  984.  
  985.  
  986.  
  987.  
  988.        The TTCD Commands and Displays                             Page 10
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.        option may be selected at any time whether that option is currently
  998.        displayed at the top of the screen or not.
  999.        
  1000.        Each of the options on the main menu is discussed below.
  1001.        
  1002.        
  1003.        4.2.1  <B>reakpoints
  1004.        
  1005.        A breakpoint is a place at which you wish to stop program execution
  1006.        and return to the debugger menu.  TTCD has ten user-definable
  1007.        breakpoints.  They are numbered 0 thru 9.  These ten breakpoints
  1008.        are divided into two types.  They are:
  1009.        
  1010.            o  "Non-sticky" breakpoints - these are breakpoints that are
  1011.               automatically cleared anytime the debugger becomes active
  1012.               again.  When the debugger menu returns, all non-sticky
  1013.               breakpoints are cleared.  Breakpoints 0 thru 4 are non-
  1014.               sticky breakpoints.  <M>acros are useful for repeatedly
  1015.               setting non-sticky breakpoints selectively.
  1016.            
  1017.            o  "Sticky" breakpoints - these are breakpoints that are active
  1018.               until actually cleared, or until the debugger is exited.
  1019.               All sticky breakpoints will still be active when a <G>o or
  1020.               <A>nimate command is selected again.  Breakpoints 5 thru 9
  1021.               are sticky breakpoints.  <M>acros are useful for "turning
  1022.               on" or "turning off" sets of sticky breakpoints selectively.
  1023.        
  1024.        Breakpoints are active during program <A>nimation if the "Animation
  1025.        Breakpoints" option is enabled.  They are not active when tracing
  1026.        (see the <T>race command, section 4.2.13) through a program.  If
  1027.        the "Animation Breakpoints" option is enabled, pressing <ESC> to
  1028.        terminate program animation will not clear the non-sticky
  1029.        breakpoints.  The non-sticky breakpoints will be cleared if the
  1030.        animation is halted by reaching a breakpoint.
  1031.        
  1032.        When the <B>reakpoint command is selected, the user will be asked
  1033.        for a breakpoint number.  When a number key (<0> thru <9>) is
  1034.        pressed, the following menu will be displayed:
  1035.        
  1036.            <C>onditional  <D>isplay  <L>ine number  <P>rocedure  <R>eset
  1037.        
  1038.        Each of these options is discussed below.
  1039.        
  1040.        All user-defined breakpoints have a loop count associated with
  1041.        them.  The repeat count (see section 4.3) specifies the loop count
  1042.        of any break point.  If no repeat count is entered, the loop count
  1043.        is initialized to 1, except for conditional breakpoints, which are
  1044.        initialized to 9999.  A breakpoint with a loop count of 1 will trap
  1045.        program execution the first time it is encountered.
  1046.        
  1047.        
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.        The TTCD Commands and Displays                             Page 11
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.        4.2.1.1  <C>onditional
  1064.        
  1065.        This option will allow you to set a condition for any breakpoint.
  1066.        Breakpoint conditions consist of non-compound statements of the
  1067.        form:
  1068.        
  1069.            <register> <relop> <value>
  1070.        
  1071.        or
  1072.        
  1073.            <symbol> <relop> <value>
  1074.        or
  1075.        
  1076.            <address> <relop> <value>
  1077.        
  1078.        Where:
  1079.            
  1080.            <register> is one of the registers listed in section 4.2.4.1.
  1081.            
  1082.            <address> is a global symbol name.  Note the symbol must be a
  1083.            scaler here.  If you need to compare the value of a structure
  1084.            or array member, its address must be specified.
  1085.            
  1086.            <address> is an address as specified in section 4.2.3.7.
  1087.            
  1088.            <relop> is one of the following:   =  !=  <  <=  >  >=
  1089.            
  1090.            <value> is a numeric constant.
  1091.            
  1092.        If a symbol or an address is specified, you will be asked a value
  1093.        "type".  Conditional types are a subset of the type discussed in
  1094.        section 4.2.3.6.  The conditional types are as follows:
  1095.        
  1096.            <C>har  <D>ouble  <F>loat  <I>nt  <L>ong  <U>nsigned
  1097.        
  1098.        These types are identical to their counterparts as discussed in
  1099.        section 4.2.3.6.
  1100.        
  1101.        When the condition and type are entered, you will be returned to
  1102.        the menu in 4.2.1 to complete the breakpoint setting.
  1103.        
  1104.        
  1105.        4.2.1.2  <D>isplay
  1106.        
  1107.        This option will display all breakpoint settings.  The breakpoint
  1108.        number specified is not used if this option is selected.  The
  1109.        following is displayed for each active breakpoint: the breakpoint
  1110.        number (0 thru 9), its current loop count, condition (if any), and
  1111.        address.  The following is a sample breakpoint display:
  1112.        
  1113.            Active Breakpoints:
  1114.             #  Count  Condition               Address
  1115.             1   1      None                   5565:0176 -> Line: MOD1;5
  1116.             6   1000   AX != 0x2              5565:031A -> Proc: display()
  1117.  
  1118.  
  1119.  
  1120.        The TTCD Commands and Displays                             Page 12
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.        
  1130.        This shows two breakpoints set.  Breakpoint #1 (non-sticky) is set
  1131.        to break the first time we reach line 5 of the module named "MOD1".
  1132.        Breakpoint #6 (sticky) will break when we get to the procedure
  1133.        "display()", and register AX is not equal to 2, or the 1000th time
  1134.        we get to "display()", which ever occurs first.
  1135.        
  1136.        
  1137.        4.2.1.3  <L>ine number
  1138.        
  1139.        This option will allow you to set a breakpoint to any valid line
  1140.        number in any module compiled with line numbers.  When selected,
  1141.        you will be asked the line number.  If only a number is entered,
  1142.        the current module will be assumed.  You may set a breakpoint at a
  1143.        certain line in another module by specifying the module name, a
  1144.        semicolon, and the desired line number.  For example: If I entered
  1145.        "FILE1;23", a breakpoint would be set at line 23 in the module
  1146.        "FILE1.C".  When entered, the specified breakpoint will be set to
  1147.        break before execution of that line.
  1148.        
  1149.        
  1150.        4.2.1.4  <P>rocedure
  1151.        
  1152.        This option will allow you to set a breakpoint to any valid
  1153.        procedure in any module compiled with line numbers.  When selected,
  1154.        you will be asked the procedure name.  When entered, the specified
  1155.        breakpoint will be set to break before execution of that procedure.
  1156.        
  1157.        
  1158.        4.2.1.5  <R>eset
  1159.        
  1160.        This will clear the specified breakpoint.  This would only be
  1161.        necessary for breakpoints 0 thru 4 if you set one then decide to
  1162.        remove it before execution.  These breakpoints are cleared
  1163.        automatically anytime the debugger menu returns.
  1164.        
  1165.        
  1166.        4.2.2  <C>alc
  1167.        
  1168.        The <C>alc command invokes a simple expression calculator.  When
  1169.        selected, you will be asked to enter an expression.  The expression
  1170.        may contain decimal and hexadecimal numbers (prefixed with "0x"),
  1171.        +, -, *, /, and unary minus.  When a valid expression is entered,
  1172.        its value will be displayed.  The resulting value is a signed long,
  1173.        and is printed both in decimal and hex.  For example, the following
  1174.        may be entered at the expression prompt:
  1175.        
  1176.            0x3a9 + 51 * 17
  1177.        
  1178.        The normal mathematical hierarchy is adhered to (i.e. -
  1179.        multiplication performed before addition).
  1180.        
  1181.        After evaluating an expression, you may enter another expression to
  1182.        be evaluated, or press <ESC> to return to the menu.
  1183.  
  1184.  
  1185.  
  1186.        The TTCD Commands and Displays                             Page 13
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.        
  1196.        The <C>alc command is also useful for converting numbers from hex
  1197.        to decimal and vice-versa.
  1198.        
  1199.        
  1200.        4.2.3  <D>isplay
  1201.        
  1202.        The display command allows viewing of variables, memory, the
  1203.        current "frame storage area" (the stack, and local variables), or
  1204.        the machine registers.  It may also be used to display the full
  1205.        list of public identifiers.  When this option is chosen, the
  1206.        following menu will be displayed:
  1207.        
  1208.            <G>lobal symbol  <M>emory  <P>ublics  <R>egisters  <S>tack
  1209.        
  1210.        Each of these options is discussed below.
  1211.        
  1212.        
  1213.        4.2.3.1  <G>lobal symbol
  1214.        
  1215.        This option allows you to display the value of a public identifier
  1216.        (function or global variable) by name.  When selected, you will be
  1217.        asked for the identifier name.  If the identifier is a function
  1218.        name, its address will be displayed.  If it is any other global
  1219.        symbol type, you will be asked for a 'type', as described in
  1220.        section 4.2.3.6.  When entered, the variable value will be
  1221.        displayed.
  1222.        
  1223.        
  1224.        4.2.3.2  <M>emory
  1225.        
  1226.        This option allows you to display any memory address as if it were
  1227.        the location of a C variable, of any type.  When selected, you will
  1228.        be asked for an address (see section 4.2.3.7 for valid TTCD address
  1229.        specifications), and a 'type' as described in section 4.2.3.6.
  1230.        When entered, the value at the specified address will be displayed.
  1231.        
  1232.        NOTE: The value entered, is an address expression.  Suppose we have
  1233.        the following assembler instruction:
  1234.        
  1235.            MOV  AX,[BP+FFFE]
  1236.        
  1237.        And you wish to see what value will be moved into AX before this is
  1238.        executed.  The <D>isplay <M>emory option may be used to see the
  1239.        value.  Enter the address as:
  1240.        
  1241.            BP+FFFE
  1242.        
  1243.        not:
  1244.        
  1245.            [BP+FFFE]
  1246.        
  1247.        The former would display the value at 'BP+FFFE'.  The latter would
  1248.        display the value of the address at 'BP+FFFE' - another level of
  1249.  
  1250.  
  1251.  
  1252.        The TTCD Commands and Displays                             Page 14
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.        indirection.  The latter is useful if the variable stored at
  1262.        'BP+FFFE' is a pointer, and you wish to see the value of the object
  1263.        being pointed to.
  1264.        
  1265.        
  1266.        4.2.3.3  <P>ublics
  1267.        
  1268.        This option will display all global symbols, along with their
  1269.        addresses.  When selected, all publics found in the ".MAP" file
  1270.        will be displayed, one screen at a time.  Procedure names will be
  1271.        displayed with '()' following the name.
  1272.        
  1273.        
  1274.        4.2.3.4  <R>egisters
  1275.        
  1276.        This option will display the machine register and flag values, with
  1277.        a format similar to the following:
  1278.        
  1279.            AX=0000 BX=049A CX=0000 DX=0014 SP=FFEC BP=FFF6 SI=003B DI=0454
  1280.            DS=518C ES=518C SS=518C CS=5079 IP=0174
  1281.            CF=0  SF=0  ZF=0  DF=0  OF=0  IF=1  PF=0  AF=0
  1282.        
  1283.        
  1284.        4.2.3.5  <S>tack
  1285.        
  1286.        This option will display the memory in the current 'frame', and the
  1287.        32 bytes above the current frame (where function parameters are).
  1288.        The current frame memory is the memory between [BP] and [SP].  When
  1289.        selected, the frame and parameter areas are displayed in a
  1290.        hex/ASCII dump format.  This display might resemble the following:
  1291.        
  1292.            0xA bytes local space: (BP=FF82 SP=FF78)
  1293.            [BP+FFF6]  01 00 00 00 00 00 00 00  24 40
  1294.                                                           ........$@
  1295.            Parameter space:
  1296.            [BP+0000]  DC FF 26 85 32 00 F8 1D  8C FF 32 2A 35 00 20 0E
  1297.                                                           ..&.2.....2*5. .
  1298.            [BP+0010]  20 0E 4B 05 7B 22 8C 05  7B 22 4D 00 1E 27 73 03
  1299.                                                            .K.{"..{"M..'s.
  1300.        
  1301.        This display shows a hex dump of the 10 bytes of local storage that
  1302.        the current procedure has allocated on the stack.  It also allows a
  1303.        simple way of displaying procedure parameters, and memory
  1304.        referenced to the BP register.  For example, given the following
  1305.        assembler instructions:
  1306.        
  1307.            MOV  AX,[BP+4]
  1308.            ADD  AX,[BP+FFF6]
  1309.            MOV  [BP+FFF8],AX
  1310.        
  1311.        Using the <D> <S> command, the action produced by these
  1312.        instructions is much easier to trace.  Using the above hex dump,
  1313.        these instructions will move a 0x32 into register AX, add 1 to it,
  1314.        and store the result at BP+FFF8.
  1315.  
  1316.  
  1317.  
  1318.        The TTCD Commands and Displays                             Page 15
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.        
  1328.        Note: Procedures that do not have any local storage may not set up
  1329.        a frame, and use the BP register as a frame pointer.  The <D> <S>
  1330.        command may not show anything useful in this case.  The "Standard
  1331.        Stack Frame" option can be used to force all procedures to set up a
  1332.        frame with BP as the frame pointer.
  1333.        
  1334.        The <ESC> key will stop the <D> <S> display if it scrolls off the
  1335.        screen.
  1336.        
  1337.        
  1338.        4.2.3.6  Display 'Types'
  1339.        
  1340.        When the <D> <G> option or the <D> <M> option is selected, a
  1341.        display type must be specified.  The display type menu consists of
  1342.        two lines, only one of which is displayed at a time.  They are as
  1343.        follows:
  1344.        
  1345.            <SPACE> - Menu 2  <C>har  <D>ouble  <F>loat  <H>ex  <I>nt
  1346.            <L>ong
  1347.            
  1348.            <SPACE> - Menu 1  <O>ffset  <2>-ptr  <4>-ptr  <S>tring
  1349.            <U>nsigned
  1350.        
  1351.        NOTE: The limited version of TTCD does not have the four-byte
  1352.        pointer option:
  1353.        
  1354.            <4>-ptr
  1355.        
  1356.        These specify the size and type of the item to be displayed, as
  1357.        follows:
  1358.        
  1359.            o  <C>har - the byte at the specified address is displayed as a
  1360.               character, if printable.  Also the hex value is displayed in
  1361.               parenthesis.
  1362.            
  1363.            o  <D>ouble - the 8 bytes starting at the specified address are
  1364.               displayed as a 'double' floating point number.
  1365.            
  1366.            o  <F>loat - the four bytes starting at the specified address
  1367.               are displayed as a floating point number.
  1368.            
  1369.            o  <H>ex - memory starting at the specified address is dumped
  1370.               in a hex/ASCII format.
  1371.            
  1372.            o  <I>nt - the two bytes at the specified address are displayed
  1373.               as an integer.  Also the hex value is displayed in
  1374.               parenthesis.
  1375.            
  1376.            o  <L>ong - the four bytes starting at the specified address
  1377.               are displayed as a signed long integer.  Also the hex value
  1378.               is displayed in parenthesis.
  1379.            
  1380.  
  1381.  
  1382.  
  1383.  
  1384.        The TTCD Commands and Displays                             Page 16
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.            o  <O>ffset - this option is used to specify the offset in a
  1394.               structure or array of the object whose value is to be
  1395.               displayed.  When chosen, you will be asked to specify the
  1396.               offset value.  After specifying an offset, another display
  1397.               type may be selected.  The <O>ffset is always specified in
  1398.               bytes, not in units of data-item size.  See section 4.2.3.8
  1399.               for examples its use.
  1400.            
  1401.            o  <2>-ptr - this tells TTCD that the value at the specified
  1402.               address is a 2-byte pointer to some data item.  When
  1403.               selected, the user is left at the 'type' menu to specify
  1404.               what type the pointer points to.  Another type may then be
  1405.               specified.  The value of the object pointed to is then
  1406.               displayed.  See section 4.2.3.8 for examples its use.
  1407.            
  1408.            o  <4>-ptr - this tells TTCD that the value at the specified
  1409.               address is a 4-byte pointer to a data item.  This command is
  1410.               the four-byte equivalent to the <2>-ptr option, and operates
  1411.               in a similar fashion.
  1412.            
  1413.            o  <S>tring - memory starting at the specified address is
  1414.               displayed as a string.  Non-printable and special characters
  1415.               are converted to their C equivalents. i.e. - a character 9
  1416.               is displayed as '\t'.  The string will be displayed with
  1417.               vertical bars (|) at each end of it so that leading/trailing
  1418.               white space may be seen.  If the string is longer than 50
  1419.               characters, it will be truncated, and displayed with an
  1420.               ellipses (. . .) following it.
  1421.            
  1422.            o  <U>nsigned - the two bytes at the specified address are
  1423.               displayed as an unsigned integer.  Also the hex value is
  1424.               displayed in parenthesis.
  1425.        
  1426.        The <M>acro capabilities are very useful for displaying a variable
  1427.        value after repeated <T>race or <G>o commands.
  1428.        
  1429.        
  1430.        4.2.3.7  Valid TTCD Addresses
  1431.        
  1432.        When TTCD prompts for a machine address, any of the following
  1433.        formats may be used:
  1434.        
  1435.            o  offset
  1436.            
  1437.            o  segment:offset
  1438.            
  1439.            o  [offset]
  1440.            
  1441.            o  segment:[offset]
  1442.        
  1443.        
  1444.        Where:
  1445.            Offset is a constant, a register, or a register +/- a constant.
  1446.            Segment is a constant, or a segment register.
  1447.  
  1448.  
  1449.  
  1450.        The TTCD Commands and Displays                             Page 17
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.        
  1460.        NOTE:  The address-decoding routine is 'dumb'.  In an attempt to be
  1461.        as flexible and simple as possible, it performs basic syntax
  1462.        checking only.
  1463.        
  1464.        
  1465.        4.2.3.8  <D>isplay Command Examples
  1466.        
  1467.        The <D>isplay command has the ability to display the value of any
  1468.        scaler, or string variable by global symbol name.  This command can
  1469.        be very complicated due to pointer, array, and/or structure
  1470.        combinations.
  1471.        
  1472.        In order to use these capabilities, it is important to understand
  1473.        each of the display 'types'.  The examples shown below should help
  1474.        clarify the <D>isplay 'types'.  Note that all of the 'types'
  1475.        discussed in 4.2.3.6 apply to the <D>isplay <M>emory command as
  1476.        well as the <D>isplay <G>lobal command.
  1477.        
  1478.        Example 1:
  1479.        
  1480.            Lets suppose I have the following global declaration in a small
  1481.            model program:
  1482.            
  1483.               char *ptr={"Steve"};
  1484.            
  1485.            I may display the value of the POINTER by pressing:
  1486.            
  1487.               <D> <G> ptr <I>
  1488.               (<D>isplay <G>lobal "ptr" <I>nteger)
  1489.            
  1490.            This will display (in decimal and hex) the memory location of
  1491.            where the string "Steve" is stored.
  1492.            
  1493.            The value of the OBJECT pointed to (the string "Steve") may be
  1494.            displayed by pressing:
  1495.            
  1496.               <D> <G> ptr <2> <S>
  1497.               (<D>isplay <G>lobal "ptr" <2>-ptr <S>tring)
  1498.            
  1499.            This tells TTCD to display the string pointed to by the 2-byte
  1500.            pointer "ptr".
  1501.        
  1502.        Example 2:
  1503.        
  1504.            Lets suppose I have the following declarations in a small model
  1505.            program:
  1506.            
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.        The TTCD Commands and Displays                             Page 18
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.               #include <stdio.h>
  1526.               #include <alloc.h>
  1527.               
  1528.               char *my_equ={"26.34/2"};       /*  Pointer to a string.  */
  1529.               
  1530.               struct my_struct {
  1531.                 int type;                     /*  2 byte integer.  */
  1532.                 double value;                 /*  8 byte double.  */
  1533.                 char near *equation;          /*  2 byte pointer.  */
  1534.               };
  1535.               
  1536.               struct my_struct far *my_ptr;   /*  4 byte pointer.  */
  1537.               
  1538.               main()
  1539.               {
  1540.                 my_ptr=malloc(sizeof(struct my_struct));
  1541.               
  1542.                 my_ptr->type=1000;
  1543.                 my_ptr->value=13.17;
  1544.                 my_ptr->equation=malloc(strlen(my_equ)+1);
  1545.                 strcpy(my_ptr->equation,my_equ);
  1546.               
  1547.                 .
  1548.                 .
  1549.                 (Rest of program)
  1550.                 .
  1551.                 .
  1552.               }
  1553.        
  1554.        
  1555.        The value of any of the members of "my_ptr->my_struct" can be
  1556.        displayed using the <D>isplay <G>lobal command.
  1557.        
  1558.        The integer value "my_ptr->type" may be displayed by pressing:
  1559.        
  1560.               <D> <G> my_ptr <4> <I>
  1561.               (<D>isplay <G>lobal "my_ptr" <4>-ptr <I>nteger)
  1562.        
  1563.        The double precision value "my_ptr->value" may be displayed by
  1564.        pressing:
  1565.        
  1566.               <D> <G> my_ptr <4> <O> 2 <D>
  1567.               (<D>isplay <G>lobal "my_ptr" <4>-ptr <O>ffset "2" <D>ouble)
  1568.        
  1569.        The string "my_ptr->equation" may be displayed by pressing:
  1570.        
  1571.               <D> <G> my_ptr <4> <O> 10 <2> <S>
  1572.               (<D>isplay <G>lobal "my_ptr" <4>-ptr <O>ffset "10" <2>-ptr
  1573.               <S>tring)
  1574.        
  1575.        The fourth character of the string "my_ptr->equation" may be
  1576.        displayed by pressing:
  1577.        
  1578.  
  1579.  
  1580.  
  1581.  
  1582.        The TTCD Commands and Displays                             Page 19
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.               <D> <G> my_ptr <4> <O> 10 <2> <O> 3 <C>
  1592.               (<D>isplay <G>lobal "my_ptr" <4>-ptr <O>ffset "10" <2>-ptr
  1593.               <O>ffset "3" <C>har)
  1594.               
  1595.        The TTCD key <M>acros can be very useful for repeatedly displaying
  1596.        variable values.
  1597.        
  1598.        
  1599.        4.2.4  <E>nter
  1600.        
  1601.        The <E>nter command allows you to change register or memory values.
  1602.        When selected, the following menu will be displayed:
  1603.        
  1604.            <R>egister  <M>emory
  1605.        
  1606.        Each of these options is discussed below.
  1607.        
  1608.        
  1609.        4.2.4.1  <R>egister
  1610.        
  1611.        This option will allow you to change the value of a machine
  1612.        register.  When selected, you will be asked the register name.  The
  1613.        valid register names are:
  1614.        
  1615.            Byte:     AL   CL   DL   BL   AH   CH   DH   BH
  1616.            Word:     AX   CX   DX   BX   SP   BP   SI   DI
  1617.            Segment:  ES   CS   SS   DS
  1618.        
  1619.        When a register name is entered, you will be prompted for a value.
  1620.        The value must be specified by two or four hex digits.  If a byte
  1621.        register is selected, and a word value is entered, only the lower
  1622.        byte will be set into the register.
  1623.        
  1624.        Warning:  It is NOT a good idea to change any of the following
  1625.        registers unless you know exactly what you are doing:
  1626.        
  1627.            CS   SS   SP   BP
  1628.        
  1629.        
  1630.        4.2.4.2  <M>emory
  1631.        
  1632.        If this option is selected you will be asked for an address (see
  1633.        section 4.2.3.7 for address specifications).  Next, you will be
  1634.        asked for a 'type'.  The type-specification menu is as follows:
  1635.        
  1636.            <C>har  <D>ouble  <F>loat  <H>ex  <I>nt  <L>ong  <U>nsigned
  1637.        
  1638.        Each of these types is similar to its corresponding <D>isplay
  1639.        'type', except that you will be asked for a value to put at the
  1640.        specified memory address.  The only differences are:
  1641.        
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.        The TTCD Commands and Displays                             Page 20
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.            o  <C>har - when entering characters, multiple characters may
  1658.               be entered at one time.  These characters will be put in
  1659.               memory starting at the specified address, continuing for as
  1660.               long as the input string (up to 50 characters).  The C
  1661.               special characters may be used in the input. i.e. - '\t'
  1662.               will specify character number 9.  This input routine allows
  1663.               input of any character via '\###'.  Where '###' represents
  1664.               up to 3 hex digits.
  1665.            
  1666.               NOTE: Due to ambiguities, you should be very careful when
  1667.               specifying a character via  '\###'.  For instance:
  1668.        
  1669.                   o  "\felix" is 5 characters.
  1670.                      They are: '\f'  'e'  'l'  'i'  'x'.
  1671.                      The '\f' is taken as a formfeed character.
  1672.                   
  1673.                   o  "\0felix" is 4 characters.
  1674.                      They are: '\0fe'  'l'  'i'  'x'.
  1675.                      The '\0fe' is taken as one character (0xfe).
  1676.                   
  1677.                   o  "\00felix" is 5 characters.
  1678.                      They are: '\0f'  'e'  'l'  'i'  'x'.
  1679.                      The '\00f' is taken as one character (0xf).
  1680.                   
  1681.                   o  "\000felix" is 6 characters.
  1682.                      They are: '\0'  'f'  'e'  'l'  'i'  'x'.
  1683.                      The '\000' is a null character.
  1684.        
  1685.            o  <H>ex - multiple bytes may be entered via this option.  The
  1686.               input string may be up to 50 characters long.  These values
  1687.               will be put in memory starting at the specified address.
  1688.               Hex numbers may be separated by spaces, commas, or periods
  1689.               when more than one is specified.  Any of the following are
  1690.               valid hex values:
  1691.        
  1692.                   0D0A0D0A
  1693.                   d a d a
  1694.                   0D,0A,0D,0A
  1695.                   0D.0A.0D.0A
  1696.        
  1697.        
  1698.        4.2.5  <G>o
  1699.        
  1700.        The <G>o command allows executing the program to a certain point.
  1701.        When selected, the following menu will be displayed:
  1702.        
  1703.            <F>orever  <L>ine number  <P>rocedure
  1704.        
  1705.        Each of these options is discussed below.
  1706.        
  1707.        
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.        The TTCD Commands and Displays                             Page 21
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.        4.2.5.1  <F>orever
  1724.        
  1725.        This option specifies that the <G>o command should execute until
  1726.        the end of the program or until a previously set <B>reakpoint is
  1727.        reached.  When the program ends execution or reaches a
  1728.        <B>reakpoint, the debugger menu will return.
  1729.        
  1730.        
  1731.        4.2.5.2  <L>ine numbers
  1732.        
  1733.        This option, when selected, will prompt you for a line number to
  1734.        stop at.  The specified line may be in any module compiled with
  1735.        line numbers.  It is specified similar to a <B>reakpoint line
  1736.        number.  See section 4.2.1.3 for an example.  When execution
  1737.        reaches the specified line, the debugger menu will return.
  1738.        
  1739.        Note that not all source line numbers are valid line numbers to
  1740.        stop at, only source lines that caused code to be generated can be
  1741.        used to break at.  If a "non-code" line number is specified, TTCD
  1742.        will use the next sequential line that does have code associated
  1743.        with it.
  1744.        
  1745.        
  1746.        4.2.5.3  <P>rocedure
  1747.        
  1748.        This option, when selected, will prompt you for a procedure name to
  1749.        stop at.  When execution reaches the beginning of this procedure,
  1750.        the debugger menu will return.  The procedure can be in any module
  1751.        compiled with the 'line numbers' option on.
  1752.        
  1753.        
  1754.        4.2.6  <L>ist
  1755.        
  1756.        The <L>ist command allows viewing of the source file.  When
  1757.        selected, you will be asked for a starting line number.  When
  1758.        entered, five lines of the source code in the current module will
  1759.        be listed (unless a different repeat value is specified, see
  1760.        section 4.3).  The next five lines (or repeat value number of
  1761.        lines) may be listed by pressing <SPACE>.
  1762.        
  1763.        Source code lines are truncated (not wrapped around) if they are
  1764.        too long to fit on one screen line.
  1765.        
  1766.        If the end of the current module source file is reached, a line
  1767.        stating '<End of file>' will be displayed.
  1768.        
  1769.        NOTE: Tab expansion is every 4th column, not every 8th.
  1770.        
  1771.        
  1772.        4.2.7  <K>eep
  1773.        
  1774.        The <K>eep command allows you to retain register or variable values
  1775.        or memory contents on the screen.  These will be updated each time
  1776.  
  1777.  
  1778.  
  1779.  
  1780.        The TTCD Commands and Displays                             Page 22
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.        the debugger screen returns.  When selected, the following menu
  1790.        will be displayed:
  1791.        
  1792.            <D>elete   <G>lobal symbol   <M>emory   <R>egisters
  1793.        
  1794.        Each of these options will be discussed below.
  1795.        
  1796.        NOTE:  In this version, the <K>eep <G>lobal command uses static
  1797.        addresses only.  For instance, if you have a pointer to an integer,
  1798.        and you specify to <K>eep the integer pointed to, the current
  1799.        address (pointer value) will be the address always displayed by
  1800.        that keep command.  If the pointer points to some other location in
  1801.        memory later, the integer at the original address will still be
  1802.        "kept" on the screen.  In later releases of TTCD, I plan to address
  1803.        this.
  1804.        
  1805.        
  1806.        4.2.7.1  <D>elete
  1807.        
  1808.        This option will allow you to remove a <K>eep variable.  When
  1809.        selected, you will be asked the <K>eep number to remove.  The first
  1810.        <K>eep currently displayed is number one, the second is number two,
  1811.        etc.  When a number (1 thru 5) is entered, the corresponding <K>eep
  1812.        value will be removed.
  1813.        
  1814.        
  1815.        4.2.7.2  <G>lobal Symbol
  1816.        
  1817.        This option will allow you to specify the <K>eep variable by name.
  1818.        When selected, you will be asked the symbol name.  When entered,
  1819.        you will be asked a display "type" (see section 4.2.3.6).  When the
  1820.        type is selected, the variable value will be added to the "keep"
  1821.        area at the bottom of the screen.
  1822.        
  1823.        
  1824.        4.2.7.3  <M>emory
  1825.        
  1826.        This option will allow you to specify a memory location to <K>eep.
  1827.        When selected, you will be asked the address.  When entered, you
  1828.        will be asked a display "type" (see section 4.2.3.6).  When the
  1829.        type is selected, the memory contents will be added to the "keep"
  1830.        area at the bottom of the screen.
  1831.        
  1832.        
  1833.        4.2.7.4  <R>egisters
  1834.        
  1835.        This option will allow you to <K>eep the general purpose registers
  1836.        on the screen.  When selected, the registers contents will be added
  1837.        to the "keep" area at the bottom of the screen.
  1838.        
  1839.        
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.        The TTCD Commands and Displays                             Page 23
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.        4.2.8  <M>acros
  1856.        
  1857.        When TTCD starts execution, it checks for the existence of a file
  1858.        named "TTCD.MAC".  This is the file that TTCD key macros, and the
  1859.        color and option settings are stored in.  If it is found in the
  1860.        current directory, or in the DOS path, it will be loaded
  1861.        automatically.
  1862.        
  1863.        The <M>acro command allows recording of any keystrokes entered into
  1864.        TTCD.  When selected, the following menu will be displayed:
  1865.        
  1866.            <D>isplay  <L>oad  <R>ecord  <S>ave
  1867.        
  1868.        Each option is discussed below.
  1869.        
  1870.        
  1871.        4.2.8.1  <D>isplay
  1872.        
  1873.        This option will display the recorded key strokes for the ten
  1874.        function keys.
  1875.        
  1876.        
  1877.        4.2.8.2  <L>oad
  1878.        
  1879.        This option causes all ten function key macros to be loaded from
  1880.        "TTCD.MAC".  "TTCD.MAC" is created via the <M> <S> command, and
  1881.        must be in the current directory, or in a directory specified in
  1882.        the DOS path.
  1883.        
  1884.        This command may be used to re-load the "default" macros if any are
  1885.        changed during debugging.  This command is not normally necessary
  1886.        since the macros stored in "TTCD.MAC" are automatically loaded at
  1887.        the beginning of execution.
  1888.        
  1889.        
  1890.        4.2.8.3  <R>ecord
  1891.        
  1892.        This option allows you to record or change a macro.  Macros may be
  1893.        assigned to any of the ten function keys.  When selected, you will
  1894.        be asked to press the function key you wish to assign the macro to.
  1895.        When selected, an 'R' will appear in the left column of the status
  1896.        line, as shown below:
  1897.        
  1898.            <SPACE> - Menu 3  <K>eep  <L>ist  <M>acro  <O>ptions  ...
  1899.            R=======  Module: HELLO.C    Proc: main()    Line: 10  === ...
  1900.        
  1901.        This is an indicator that a macro recording is in progress.  All
  1902.        keys pressed, until the next <M>acro command, will be recorded for
  1903.        playback when the specified function key is pressed.
  1904.        
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.        The TTCD Commands and Displays                             Page 24
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.        When recording macros:
  1922.        
  1923.            o  Only the keys entered into the debugger will be recorded.
  1924.               Any keys entered into the target program will not be
  1925.               recorded.
  1926.            
  1927.            o  Up to 99 key strokes may be recorded in one macro.
  1928.            
  1929.            o  Function keys are ignored during macro recording.
  1930.            
  1931.            o  Macros may not be nested or linked.
  1932.            
  1933.            o  The "backward apostrophe" <`> key may be used to bypass a
  1934.               key when recording a macro.  This is useful when recording
  1935.               part of a key sequence.  For instance, lets suppose I wanted
  1936.               to make the <F1> start the single-step trace mode.  The key
  1937.               required key sequence is:
  1938.            
  1939.                   <M> <R> <F1> <ESC> <T> <S> <`> <ESC> <M>
  1940.            
  1941.               The key sequence actually recorded would be:
  1942.            
  1943.                   <ESC> <T> <S>
  1944.                   
  1945.               The second <ESC> key was not recorded, only used to get out
  1946.               of the trace mode in order to finish recording the macro.
  1947.        
  1948.        
  1949.        4.2.8.4  <S>ave
  1950.        
  1951.        This option causes all ten function key macros, and the current
  1952.        configuration information to be saved in a file named "TTCD.MAC".
  1953.        The information recorded in "TTCD.MAC" will be re-loaded the next
  1954.        time TTCD is executed.
  1955.        
  1956.        
  1957.        4.2.9  <O>ptions
  1958.        
  1959.        This command allows you to set TTCD parameters.  When this command
  1960.        is selected, the following menu will be displayed:
  1961.        
  1962.            <A>nimation Brkpts  <D>isplay  <F>lip screen on trace
  1963.            <S>now suppression
  1964.        
  1965.        Each option is discussed below.
  1966.        
  1967.        
  1968.        4.2.9.1  <A>nimation Breakpoints
  1969.        
  1970.        This option will allow you to enable or disable breakpoints during
  1971.        program <A>nimation.  If enabled, the breakpoints will work similar
  1972.        to the way they function during execution via <G>o.  If disabled,
  1973.        breakpoints will not stop program <A>nimation.  Note that if
  1974.  
  1975.  
  1976.  
  1977.  
  1978.        The TTCD Commands and Displays                             Page 25
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.        <A>nimation is terminated by pressing the <ESC> key, non-sticky
  1988.        breakpoints will not be cleared.
  1989.        
  1990.        
  1991.        4.2.9.2  <D>isplay
  1992.        
  1993.        This option will display the current TTCD option settings and
  1994.        return to the main menu.
  1995.        
  1996.        
  1997.        4.2.9.3  <F>lip screen on trace
  1998.        
  1999.        The "<F>lip screen on trace" option allows you to specify whether
  2000.        you want the target program screen replaced each time a statement
  2001.        is executed via <T>race.  If it is set ON, the "program screen" and
  2002.        "debugger screen" will be swapped between each statement traced.
  2003.        If it is set to OFF, some target program screen I/O may be lost.
  2004.        When off, tracing and animation is much faster particularly if the
  2005.        target program is in a graphics mode.
  2006.        
  2007.        This option may also be toggled on or off while in the trace mode.
  2008.        
  2009.        
  2010.        4.2.9.4  <S>now suppression
  2011.        
  2012.        The "<S>now suppression" option allows you to specify whether you
  2013.        want CGA "snow" suppressed each time the screen is flipped to or
  2014.        from the debugger screen.  If this is set ON, you should not see
  2015.        any "glitching" when the screen is flipped.  If this is set off,
  2016.        screen switching will be much faster in the text mode.
  2017.        
  2018.        Since screen snow does not occur when in any graphics mode, this
  2019.        option is only effective when the target program is in the text
  2020.        mode.
  2021.        
  2022.        Machines equipped with an EGA card should not have snow, regardless
  2023.        of the mode, however, many CGA cards have this problem.
  2024.        
  2025.        
  2026.        4.2.10  <Q>uit
  2027.        
  2028.        This command allows you to exit TTCD.  When this command is
  2029.        selected, the following menu will be displayed:
  2030.        
  2031.            <N>o   <Y>es   <R>estart
  2032.        
  2033.        Press <Y> to exit TTCD, <N> to resume debugging, or <R> to re-start
  2034.        execution of the target program.  If the <R>estart option is
  2035.        selected, the program screen contents will be left as it is
  2036.        currently displayed.
  2037.        
  2038.        Selecting <Y> will cause the target program to immediately exit.
  2039.        Any "atexit" functions will not be executed, files will not be
  2040.  
  2041.  
  2042.  
  2043.  
  2044.        The TTCD Commands and Displays                             Page 26
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.        flushed, etc.  However, any memory allocated via standard calls
  2054.        (including allocmem()) should be freed properly.
  2055.        
  2056.        
  2057.        4.2.11  <P>rint
  2058.        
  2059.        This command allows a simple way to send debugging information to
  2060.        the printer.  When selected, the "print option" will toggle.  Its
  2061.        default state is off.  When the print option is on, a 'P' will
  2062.        appear in the second column of the status line, and all debugging
  2063.        output will go to the printer as well as the screen.
  2064.        
  2065.        Debugging a program that is also printing may cause some confusion,
  2066.        but should work properly.
  2067.        
  2068.        
  2069.        4.2.12  <S>creen
  2070.        
  2071.        This command will display the 'program screen'.  When selected, the
  2072.        screen contents of the target program will be displayed.  Press any
  2073.        key to return to the debugger screen.
  2074.        
  2075.        NOTE: If the program being debugged displays any CGA or EGA
  2076.        graphics, the '-C' or the '-E' debugger option must be specified to
  2077.        set aside enough memory for the screen contents.  See section 3.1
  2078.        for a description of command line options.
  2079.        
  2080.        
  2081.        4.2.13  <T>race
  2082.        
  2083.        This command allows you to step through program execution.  When
  2084.        selected, the following menu will be displayed:
  2085.        
  2086.            <A>nimate   <S>ingle step   <P>roc step
  2087.        
  2088.        These commands are discussed below.
  2089.        
  2090.        
  2091.        4.2.13.1 <A>nimate
  2092.        
  2093.        This option allows variable-speed continuous <S>ingle step or
  2094.        <P>roc step tracing.  When selected, you will be asked the speed.
  2095.        The fastest animation speed is 0, the slowest allowed is 50.  When
  2096.        a number 0 thru 50 is entered, you will be returned to the <T>race
  2097.        menu.  At this point, you may select <A>nimate again to change your
  2098.        speed, or select <S>ingle step or <P>roc step to start execution.
  2099.        
  2100.        The <A>nimation Breakpoints option will allow you to enable or
  2101.        disable breakpoints during <A>nimation.  See section 4.2.9.1.
  2102.        
  2103.        
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.        The TTCD Commands and Displays                             Page 27
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.        4.2.13.2 <S>ingle step
  2120.        
  2121.        This option will allow you to execute one line of the target
  2122.        program at a time.  When selected, the next source line to be
  2123.        executed will be displayed with an arrow pointing to it.  Also, the
  2124.        following menu will be displayed:
  2125.        
  2126.            <A>nimate  <SPACE> = <S>ingle step,  <P>roc step,  <F>lip = ON
  2127.        
  2128.        Each time <SPACE> or <S> is pressed, the next statement will be
  2129.        executed, and the next line will be displayed with an arrow
  2130.        pointing to it.  Press <A> to start animation (see section
  2131.        4.2.13.1).  Press <P> to change the trace mode to <P>roc tracing
  2132.        (see section 4.2.13.3).  Press <F> to toggle the "Flip screen on
  2133.        trace" option (see section 4.2.9.3).  Any other key will end the
  2134.        trace mode and return to the main menu.
  2135.        
  2136.        When the <S>ingle step mode reaches a function call, that function
  2137.        will be stepped through if it is in a module compiled with line
  2138.        numbers.  NOTE: You may only single step through procedures that
  2139.        are in modules compiled with the 'line numbers' option on.
  2140.        
  2141.        
  2142.        4.2.13.3 <P>roc step
  2143.        
  2144.        This option will allow you to execute one line of the target
  2145.        program at a time.  When selected, the next source line to be
  2146.        executed will be displayed with an arrow pointing to it.  Also, the
  2147.        following menu will be displayed:
  2148.        
  2149.            <A>nimate  <S>ingle step,  <SPACE> = <P>roc step,  <F>lip = ON
  2150.        
  2151.        Each time <SPACE> or <P> is pressed, the next statement will be
  2152.        executed, and the next line will be displayed with an arrow
  2153.        pointing to it.  Press <A> to start animation (see section
  2154.        4.2.13.1).  Press <S> to change the trace mode to <S>ingle tracing
  2155.        (see section 4.2.13.2).  Press <F> to toggle the "Flip screen on
  2156.        trace" option (see section 4.2.9.3).  Any other key will end the
  2157.        trace mode and return to the main menu.
  2158.        
  2159.        <P>roc tracing differs from <S>ingle step tracing in that
  2160.        procedures are not traced, but executed in one step.  Even if a
  2161.        procedure is in a module compiled with line numbers, it will not be
  2162.        stepped through if its calling function is being <P>roc traced.
  2163.        
  2164.        
  2165.        4.2.13.4  Using <T>race
  2166.        
  2167.        Due to the way the trace mode must work, long delays may be caused
  2168.        with looping constructs on one line.  For instance, if a section of
  2169.        code reads:
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.        The TTCD Commands and Displays                             Page 28
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.        
  2186.            99   j=10000;
  2187.            100  for(i=0;i<j;i++)  array[i] = (array[i] >> 2) + array[i+1];
  2188.            101  printf("Loop completed %u iterations\n",j);
  2189.        
  2190.        Using the <A>, <S> or <P> commands to trace through the statements
  2191.        above will work fine, however, line 100 may take several minutes to
  2192.        step through.  One solution is to avoid single-line looping
  2193.        statements.  The following is more readable anyway:
  2194.        
  2195.            99   j=10000;
  2196.            100  for(i=0;i<j;i++)
  2197.            101     array[i]= (array[i] >> 2) + array[i+1];
  2198.            102  printf("Loop completed %u iterations\n",j);
  2199.        
  2200.        This may be stepped through also, but after seeing line 101 several
  2201.        times, you may be inclined to use the <G>o command instead of
  2202.        pressing <SPACE> 10,000 times.
  2203.        
  2204.        If you are fond of single-line looping constructs and do not wish
  2205.        to change your programming style, another solution is to <T>race up
  2206.        to the line,  use the <G>o command to jump past it, and resume
  2207.        tracing with the following line.
  2208.        
  2209.        NOTE: When a C statement extends over multiple source lines, the
  2210.        <T>race command will only show the last line of the statement (with
  2211.        an arrow pointing to it).
  2212.        
  2213.        
  2214.        4.2.14  <U>nassemble
  2215.        
  2216.        This command allows you to un-assemble program code.  When
  2217.        selected, you will be asked for a line number.  When entered, a
  2218.        disassembly listing will be displayed for the code in the specified
  2219.        line.  Pressing <SPACE> will display a disassembly listing of
  2220.        successive source lines, one at a time.  Any other key will return
  2221.        to the main menu.
  2222.        
  2223.        The code at any address may be un-assembled by entering the address
  2224.        preceded by an 'a'.  For instance, when prompted for the line
  2225.        number to start un-assembling at, if "a100" is entered, a
  2226.        disassembly listing will be displayed, starting CS:100.  A starting
  2227.        segment may also be specified, such as "a6d00:0174".
  2228.        
  2229.        The instructions displayed by the <U>nassemble command differ
  2230.        slightly from Intel/MASM assembler instructions, as discussed in
  2231.        section 5.2.  One addition to the disassembled instructions is the
  2232.        appearance of global symbol names out to the right of some
  2233.        instructions.  Any instruction containing an address corresponding
  2234.        to a global symbol location will have that symbol displayed
  2235.        following the instruction.  The symbol will be enclosed in angle
  2236.        brackets. '<>'.  For instance, an <U>nassemble listing may resemble
  2237.        the following:
  2238.  
  2239.  
  2240.  
  2241.  
  2242.        The TTCD Commands and Displays                             Page 29
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.        
  2252.            == 51 ==
  2253.            560D:00E1  E97B01        JMP   25F
  2254.            == 53 ==
  2255.            560D:00E4  B80100        MOV   AX,1
  2256.            560D:00E7  50            PUSH  AX
  2257.            560D:00E8  FF364E0D      PUSH  [0D4E]          <currow>
  2258.            560D:00EC  FF36BF0D      PUSH  [0DBF]          <curcol>
  2259.            560D:00F0  9A0202C759    LCALL 59C7:0202       <deletecell()>
  2260.            560D:00F5  83C406        ADD   SP,6
  2261.            == 54 ==
  2262.            560D:00F8  9A6B03C759    LCALL 59C7:036B       <printfreemem()>
  2263.            == 55 ==
  2264.            560D:00FD  803E860000    CMP   BYTE [0086],0   <autocalc>
  2265.            560D:0102  7503          JNE   0107
  2266.            560D:0104  E95801        JMP   25F
  2267.            
  2268.        This is a disassembly of lines 51 thru 55.  Notice that line 52 is
  2269.        not listed.  This is because no code was generated from this line
  2270.        of source code.  Note that 'deletecell()' and 'printfreemem()' are
  2271.        procedures, while 'currow', 'curcol', and 'autocalc' are variables.
  2272.        
  2273.        Due to the way 8086 instructions may be indexed, it is possible for
  2274.        a global symbol to be displayed erroneously because its address
  2275.        matched a "displacement" value in an instruction.  This should be
  2276.        rare, but it can happen.
  2277.        
  2278.        Warning: Any model that has 4-byte addresses, may not display some
  2279.        global symbol names.  For instance, in the above section of code,
  2280.        lets suppose I was just looking at a disassembly of line 51, but
  2281.        was currently at line 347, the DS register may have a different
  2282.        value, and the address DS:0D4E would not correspond to the location
  2283.        of "currow".  If this were the case, the "<currow>" symbol would
  2284.        not be displayed to the right of the instruction at 560D:00E8.  The
  2285.        is also true for statements that have a "segment override", such
  2286.        as:
  2287.        
  2288.          MOV  AX,ES:[0D4E]
  2289.        
  2290.        If ES did not have the value at dis-assembly time that it will have
  2291.        at execution time, the global symbol name will not be displayed.
  2292.        
  2293.        
  2294.        4.3  The Repeat Count
  2295.        
  2296.        The "repeat count" is a number from 0 to 9999 entered at the main
  2297.        menu.  It is used to specify "how many times" the next command does
  2298.        some action.  The repeat count is used differently for different
  2299.        commands, and is a very powerful command option if used properly.
  2300.        
  2301.        The repeat count is displayed near the left end of the status line.
  2302.        
  2303.        The repeat count is used in conjunction with each command discussed
  2304.        below.
  2305.  
  2306.  
  2307.  
  2308.        The TTCD Commands and Displays                             Page 30
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.        
  2318.            o  <B>reakpoints - A repeat count greater than 1 when a
  2319.               breakpoint is set will cause the breakpoint to be "ignored"
  2320.               N-1 times.  The default is 1.  For instance, if I press:
  2321.        
  2322.                   <1> <5> <B> <1> <L> 10
  2323.        
  2324.               This will set a non-sticky breakpoint (number 1) to line 10,
  2325.               but the breakpoint will be dormant for 14 "passes" through
  2326.               line 10.  On the 15th time line 10 is reached, the
  2327.               breakpoint will return control to the debugger.
  2328.        
  2329.            o  <D>isplay - the repeat count determines the number items
  2330.               displayed.  The default is 1.  The repeat count is ignored
  2331.               if the display type is <H>ex or <S>tring.
  2332.        
  2333.            o  <G>o - A repeat count greater than 1 when the <G>o command
  2334.               is selected will cause execution to "pass-through" the
  2335.               specified line or procedure N-1 times.  The default is 1.
  2336.               For instance, if I press:
  2337.        
  2338.                   <5> <3> <G> <P> update_display
  2339.        
  2340.               The fifty-third time "update_display()" is called, control
  2341.               will return to the debugger main menu.
  2342.        
  2343.            o  <L>ist - The repeat count determines the number of lines
  2344.               listed each time <SPACE> is pressed.  The default is 5.
  2345.            
  2346.            o  <U>nassemble - The repeat count determines the number of
  2347.               lines un-assembled each time <SPACE> is pressed.  The
  2348.               default is 1.
  2349.        
  2350.        
  2351.        4.4  Program Termination
  2352.        
  2353.        When the target program ends execution (either normally, or
  2354.        abnormally), the message "Execution Terminated (return value=%d)"
  2355.        will be displayed.  The "%d" will be replaced with the value
  2356.        returned by the program (i.e. - the number specified in the
  2357.        "exit()" command).
  2358.        
  2359.        NOTE: If there is not enough memory to execute the target program,
  2360.        the program termination message may be displayed erroneously.  See
  2361.        section 5.8.
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.        The TTCD Commands and Displays                             Page 31
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.        5.0  Notes about Debugging with TTCD
  2384.        
  2385.        
  2386.        5.1  Source Code Formatting
  2387.        
  2388.        The format of C source code can cause the line numbers in the .MAP
  2389.        file to be seemingly incorrect. This can cause some confusion when
  2390.        trying to debug programs.  Simple changes in the source code
  2391.        formatting style can minimize this problem.  The following is a
  2392.        list of source-formatting considerations when writing programs:
  2393.        
  2394.            o  One C statement per line line.  A 'while' or 'for' construct
  2395.               is counted as a separate statement here.
  2396.            
  2397.            o  Put 'else' statements on lines by themselves.
  2398.            
  2399.            o  Looping constructs should have a blank line after the
  2400.               statements in the body of the loop, or have the close-brace
  2401.               on a line by itself.  For instance:
  2402.            
  2403.                  15 for(i=0;i<100;i++)
  2404.                  16   *ptr++=0;
  2405.                  17 printf("Loop complete\n");
  2406.            
  2407.               A blank line inserted before line 17 will make this portion
  2408.               of the code easier to trace.
  2409.        
  2410.        These are never necessary, but can make source-level debugging much
  2411.        easier to follow.
  2412.        
  2413.        
  2414.        5.2  Mnemonic Differences
  2415.        
  2416.        Some of the instruction mnemonics displayed by the <U>nassemble
  2417.        command will differ slightly from Intel/MASM mnemonics.  These have
  2418.        been changed for reasons of clarity.  For instance, a disassembly
  2419.        showing a RET instruction does not tell us if it is a 2-byte (near)
  2420.        or 4-byte (far) return.
  2421.        
  2422.        The major deviations from MASM/Intel mnemonics are with the JMP,
  2423.        CALL, and RET instructions.  TTCD uses JMP, CALL, and RET
  2424.        instructions to refer to NEAR control transfers.  LJMP, LCALL, and
  2425.        LRET are the respective FAR control transfers of these
  2426.        instructions.  Also the format of indirect instructions has been
  2427.        simplified, as shown below.
  2428.        
  2429.            MASM                              TTCD
  2430.            
  2431.            CALL WORD  PTR [100]              CALL  [100]
  2432.            CALL DWORD PTR [100]              LCALL [100]
  2433.            JMP  WORD  PTR [100]              JMP   [100]
  2434.            JMP  DWORD PTR [100]              LJMP  [100]
  2435.        
  2436.  
  2437.  
  2438.  
  2439.  
  2440.        Notes about Debugging with TTCD                            Page 32
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.        In general the word "PTR" is not used, and data-size modifiers
  2450.        (such as "BYTE" or "WORD") are only used when required.
  2451.        
  2452.        
  2453.        5.3  Special Interrupts
  2454.        
  2455.        Turbo C uses different interrupt vectors to handle floating point
  2456.        emulation than those specified in the Intel Technical Reference
  2457.        manuals.  They are INT numbers: 0x35, 0x37, 0x38, 0x39, 0x3a, 0x3c
  2458.        and 0x3d.  These interrupts are treated in a special manner.  TTCD
  2459.        will attempt to decode a variable number of bytes following any of
  2460.        these INT instructions.  If any incorrect decoding (due to some
  2461.        other use for any of these INT's) is encountered during tracing,
  2462.        TTCD will display incorrect un-assembly listings, and may lose
  2463.        control of the target program.
  2464.        
  2465.        
  2466.        5.4  Floating Point Emulation Deviations
  2467.        
  2468.        As mentioned above, Turbo C code differs somewhat from Intel 8087
  2469.        emulation specs.  Because of this, I have had to handle some
  2470.        floating point emulation code by "seat of the pants" methods.  If
  2471.        you should ever encounter an <U>nassemble listing that has no
  2472.        mnemonic on a line, then I have missed an instruction type.  PLEASE
  2473.        LET ME KNOW OF ANY SUCH OCCURRENCE.  If you are a registered full
  2474.        version user, you will be able to download a fixed version, when
  2475.        available.
  2476.        
  2477.        
  2478.        5.5  Floating Point Problems
  2479.        
  2480.        There seems to be a minor bug in Turbo C causing a problem with
  2481.        some line numbers in the .MAP file.  It seems that any source line
  2482.        whose first assembler instruction is a floating point instruction
  2483.        (8087 or emulation code) will not have a line number entry in the
  2484.        .MAP file.  For example, given the following source code:
  2485.        
  2486.            #include <stdio.h>
  2487.            #include <math.h>
  2488.            
  2489.            main()
  2490.            {
  2491.              float dbl1=1,dbl2=1;
  2492.            
  2493.              printf("Line 8\n");
  2494.              dbl1=dbl1+dbl2;
  2495.              printf("Line 10\n");
  2496.            
  2497.              exit(0);
  2498.            }
  2499.            
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.        Notes about Debugging with TTCD                            Page 33
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.        Tracing through this program with the <P>rint option on will print
  2516.        the following:
  2517.        
  2518.            5     ->{
  2519.            6     ->  float dbl1=1,dbl2=1;
  2520.            8     ->  printf("Line 8\n");
  2521.            10    ->  printf("Line 10\n");
  2522.            12    ->  exit(0);
  2523.            Execution terminated (return value=0)
  2524.        
  2525.        Notice that line 9 was not traced.  This is due to the missing line
  2526.        number in the .MAP file.  Also, line 9 cannot be specified for:
  2527.        <B>reakpoint, <G>oto, or <U>nassemble.
  2528.        
  2529.        A simple work-around is to put a "dummy" line of code in front of
  2530.        any such line (for debugging purposes), and use it as the target of
  2531.        a <B>reakpoint, <G>oto, or <U>nassemble.  For instance, the
  2532.        following line of C will work nicely:
  2533.        
  2534.          _AL=1;
  2535.        
  2536.        
  2537.        5.6  Optimization Options
  2538.        
  2539.        If the "Use register variables" option is on, it is possible for
  2540.        the <D> <G> command to show incorrect values.  This is due to the
  2541.        compiler keeping some variable values temporarily in registers.
  2542.        The <U>nassemble command can be used to check for this.  Use the
  2543.        <D> <R> command to display register values.
  2544.        
  2545.        If the "Jump optimization" option is on, tracing through some
  2546.        statements may lead to a little confusion.  This is particularly
  2547.        true of "switch" statements.  It is best to leave this option off
  2548.        if you are new to TTCD.
  2549.        
  2550.        
  2551.        5.7  The "#line" Directive
  2552.        
  2553.        The #line directive causes the compiler to re-map the line numbers
  2554.        put in an object file compiled with line numbers.  If the #line
  2555.        directive is specified in a source module, that you intend to view
  2556.        in TTCD, the source lines displayed may not be correct lines
  2557.        corresponding to a location in the code segment.  If at some point
  2558.        in the program TTCD thinks you are at a certain line, it may be
  2559.        displaying a different source code line on the screen because of a
  2560.        previous #line directive.
  2561.        
  2562.        
  2563.        5.8  Memory Considerations
  2564.        
  2565.        Due to the way that child processes are loaded and executed, it is
  2566.        possible to not get an "out of memory" error message when the
  2567.        process-spawning routine really does run out of memory.
  2568.        
  2569.  
  2570.  
  2571.  
  2572.        Notes about Debugging with TTCD                            Page 34
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.        In most cases, if there is not enough memory to execute the target
  2582.        program, an error message will be displayed, and TTCD will exit to
  2583.        DOS.
  2584.        
  2585.        It is possible for TTCD to display the message "Execution
  2586.        Terminated" when the target program did not attempt to run at all.
  2587.        This seems to happen if there is enough memory to load and relocate
  2588.        a load-module, but not enough memory to start execution of it
  2589.        (which requires setting up stack space, and the uninitialized data
  2590.        space).
  2591.        
  2592.        
  2593.        5.9  Interrupt Vector Trapping
  2594.        
  2595.        In order to debug Turbo C programs that trap an interrupt vector
  2596.        (or otherwise modify the interrupt vector table), TTCD preserves
  2597.        the interrupt vector table.
  2598.        
  2599.        TTCD has not been tested extensively with programs that modify the
  2600.        interrupt vector table, but most "interrupt-trapping" programs
  2601.        should be able to used with it.  There will probably be some
  2602.        difficulty in attempting to use TTCD to debug any program that
  2603.        traps a "timed" interrupt vector.
  2604.        
  2605.        Care should be taken if any interrupt vectors are set to point to
  2606.        procedures in the target program.  TTCD will not be able to trace
  2607.        through the procedure unless trapped by a <B>reakpoint, and then
  2608.        traced.  Note that if the "interrupt" procedure transfers control
  2609.        to another point in the target program (via "longjmp"), TTCD may
  2610.        lose control of execution, unless you are tracing the interrupt
  2611.        procedure, or use a <B>reakpoint.  For instance, if a target
  2612.        program traps the <Ctrl><Break> vector, and then does a long jump
  2613.        to the program's main menu, it is a good idea to set a sticky
  2614.        breakpoint at the program's main menu.  This will allow you to
  2615.        press <Ctrl><Break> while debugging your program, and TTCD will
  2616.        still maintain control of it.
  2617.        
  2618.        NOTE: TTCD uses interrupt vector number 3.  If any target program
  2619.        changes this vector, TTCD will "lose control" of execution of it.
  2620.        
  2621.        
  2622.        5.10  Trapping Math Errors
  2623.        
  2624.        TTCD will not trap, or control the trapping of math errors in any
  2625.        target program.  In other words, if the target program traps math
  2626.        errors on its own, that routine will still trap math errors when
  2627.        executed under TTCD.
  2628.        
  2629.        If math errors are not trapped, the default action for Turbo C to
  2630.        generate is a one-line error message, then abort the program with a
  2631.        return value of 3.
  2632.        
  2633.  
  2634.  
  2635.  
  2636.  
  2637.  
  2638.        Notes about Debugging with TTCD                            Page 35
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.        This is worth mentioning because, while tracing through a program,
  2648.        you may not see an error message flash by, only the TTCD message
  2649.        "Execution Terminated (return value=3)".  If the "Flip screen on
  2650.        <T>race" option is on, any error message should be on the target
  2651.        program screen; otherwise, it may be overwritten by debugging
  2652.        information.
  2653.  
  2654.  
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.        Notes about Debugging with TTCD                            Page 36
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.        6.0  Input responses to TTCD prompts
  2714.        
  2715.        
  2716.        6.1  Input field editing
  2717.        
  2718.        Inputs to TTCD may be edited using the cursor keys.  The following
  2719.        keys are used for input editing:
  2720.        
  2721.        <ENTER>                 Enter the displayed input into TTCD.  The
  2722.                                cursor does not have to be at the end of
  2723.                                the input string when <ENTER> is pressed.
  2724.        
  2725.        <BackSpace>             Move the cursor left in the input field,
  2726.                                erasing characters as it goes.
  2727.        
  2728.        <Del>                   Delete the character under the cursor.
  2729.        
  2730.        
  2731.        <Home>                  Move the cursor to the beginning of the
  2732.                                input field.
  2733.        
  2734.        <End>                   Move the cursor to the last character in
  2735.                                the input field.
  2736.        
  2737.        <left arrow>            Move the cursor left in the input field,
  2738.                                but do not erase characters.
  2739.        
  2740.        <right arrow>           Move the cursor right in the input field.
  2741.        
  2742.        <Ctrl><left arrow>      Move the cursor left one word.
  2743.        
  2744.        <Ctrl><right arrow>     Move the cursor right one word.
  2745.        
  2746.        <Ctrl><Home>            Erase from the current cursor position to
  2747.                                the beginning of the input field.
  2748.        
  2749.        <Ctrl><End>             Erase from the current cursor position to
  2750.                                the end of the input field.
  2751.        
  2752.        
  2753.        Many input prompts are pre-filled with expected values.  If a value
  2754.        is displayed, you may: press the <ENTER> key to input it, use the
  2755.        editing keys to edit it, or just type the desired response, and it
  2756.        will be cleared automatically.
  2757.        
  2758.        
  2759.        6.2  Case sensitivity
  2760.        
  2761.        Like the C language, all input responses to TTCD prompts are case
  2762.        sensitive.  An exception to this is hex digits.  When a hex number
  2763.        is entered, its digits may be upper or lower case.  Any global
  2764.        symbol name entered in response to a TTCD prompt will not be found
  2765.        if the letters do not match exactly.
  2766.        
  2767.  
  2768.  
  2769.  
  2770.        Notes about Debugging with TTCD                            Page 37
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.        
  2780.        6.3  Input Radix Defaults
  2781.        
  2782.        When TTCD prompt for a numeric input of some kind, it expects hex
  2783.        numbers in some cases, and decimal in others.  To be specific,
  2784.        addresses or address offsets are expected in hexadecimal.  Non-
  2785.        address values (i.e. - a conditional breakpoint comparison value,
  2786.        input to the <C>alculator, etc.) are expected to be decimal
  2787.        numbers.  A hexadecimal number may be entered where a decimal
  2788.        number is expected, by prefixing the number with a "0x".  (Just
  2789.        like in the "C" language.)
  2790.        
  2791.        
  2792.        6.4  Address Specification Defaults
  2793.        
  2794.        All addresses entered into TTCD that do not contain a segment
  2795.        specification have an implied segment register.  The default
  2796.        segment values are similar to those used when programming in
  2797.        assembler.  These can always be overridden by specifying a segment
  2798.        value, or a segment register in the address expression.
  2799.        
  2800.        The implied segment values are as follows:
  2801.        
  2802.            CS - If the address is 'code' related.
  2803.            
  2804.            SS - If the address expression contains SP or BP.
  2805.            
  2806.            DS - All other addresses.
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.        Notes about Debugging with TTCD                            Page 38
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.        7.0  TTCD.MAC Format and Use
  2846.        
  2847.        
  2848.        If there is a file named "TTCD.MAC" in the current directory, or
  2849.        the DOS path, it is loaded when TTCD begins execution.  This file
  2850.        contains TTCD configuration information, and the key macros last
  2851.        saved (via the <M> <S> command).
  2852.        
  2853.        The format of TTCD.MAC is:
  2854.        
  2855.            Offset
  2856.            (byte)                Use
  2857.            ------                ---
  2858.            0             Color of non-highlighted menu characters.
  2859.            1             Color of highlighted menu characters.
  2860.            2             Status line color.
  2861.            3             "Keep" information color.
  2862.            4             Input prompt color.
  2863.            5             Input response color.
  2864.            6             Color of main debugging area.
  2865.            7             Color of traced lines.
  2866.        
  2867.            8-10          Reserved for future use.
  2868.        
  2869.            11-13         Option Settings.
  2870.        
  2871.            14-20         Reserved for future use.
  2872.        
  2873.            20+           Extended key codes for each of the 10 macro keys.
  2874.        
  2875.        The first 8 bytes in TTCD.MAC are the attributes bytes for the
  2876.        specified screen areas.  These may be changed with the DOS DEBUG
  2877.        program, or a hex file editor.
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.        TTCD Details and Nomenclature                              Page 39
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.        8.0  Known TTCD Bugs and Anomalies
  2912.        
  2913.        At the time of this writing, there is one known bug in TTCD.  As
  2914.        discussed in section 5.8, it is possible for the target program to
  2915.        abend with an error code of 3, when it did not really execute at
  2916.        all.
  2917.  
  2918.  
  2919.  
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.        Known TTCD Bugs and Anomalies                              Page 40
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.        9.0  Version Changes/Modification to TTCD
  2978.        
  2979.          Version     Enhancements/Modifications
  2980.          -------     ------------ -------------
  2981.          1.0         Beta test release
  2982.          
  2983.          1.1         Added colors, enhanced screen handling and snow
  2984.                      suppression.
  2985.          
  2986.                      Corrected some dis-assembly bugs.
  2987.          
  2988.          
  2989.          1.2         Added conditional breakpoints.
  2990.          
  2991.                      Added <K>eep command.
  2992.          
  2993.                      Made colors configurable.
  2994.          
  2995.                      Enhanced key macros.
  2996.          
  2997.                      Corrected more dis-assembly bugs.
  2998.          
  2999.          
  3000.          1.3         Added Target program "animation".
  3001.          
  3002.                      Added <V>iew command.
  3003.          
  3004.                      Added <C>alc command.
  3005.          
  3006.                      Added -B (File buffer size) command line option.
  3007.          
  3008.                      Added full support for target program re-direction
  3009.                      (thru DOS).
  3010.          
  3011.                      Corrected some input error checking.
  3012.          
  3013.          
  3014.          1.4         Added the ability to turn on breakpoints during
  3015.                      program animation.
  3016.          
  3017.                      Added an option to display the current <O>ption
  3018.                      settings.
  3019.          
  3020.                      Now uses the DOS path to find the configuration file
  3021.                      "TTCD.MAC".
  3022.          
  3023.                      Enhanced keyboard menu input.
  3024.          
  3025.                      Now saves the configuration items in "TTCD.MAC".
  3026.          
  3027.          
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.        Version Changes/Modification to TTCD                       Page 41
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.          1.5         Corrected to use the next line if a specified line
  3044.                      number does not have any code associated with it.
  3045.          
  3046.                      Added a <R>estart option to the <Q>uit menu.
  3047.          
  3048.                      Now supports source code in other drives/directories.
  3049.          
  3050.                      Now accepts a module name associated with a source
  3051.                      code line number when specifying breakpoints or <G>o
  3052.                      addresses.
  3053.          
  3054.                      Corrected to clear non-sticky breakpoints after
  3055.                      <A>nimation only if it was not aborted.
  3056.          
  3057.                      Included "conditional breakpoint" macro include file
  3058.                      "COND.H".
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.        Version Changes/Modification to TTCD                       Page 42
  3101.  
  3102.  
  3103.