



















                                     MON96

                                       A
                             Software Debug Monitor

                                  For the 8096










                          Dunfield Development Systems
                          ----------------------------
                             High quality tools for
                              Embedded Development
                                 at low prices.

                            http://www.dunfield.com


                       ?COPY.TXT 1991-2007 Dave Dunfield
                              **See COPY.TXT**



                                     MON96

                               TABLE OF CONTENTS


                                                                         Page

     1. INTRODUCTION                                                        1


     2. USING MON96                                                         2

        2.1 Monitor Commands                                                2
        2.2 Display Output                                                  4
        2.3 Interrupts                                                      4
    MON96                                                            Page: 1


    1. INTRODUCTION

          MON96 is an interactive software  debugger  and  machine  language
       monitor for the Intel 8096 family  of  microprocessors.  It  contains
       display/alter memory/register facilities,  as well  as  a  full  8096
       disassembler, breakpoint, and software single step functions.

          MON96  requires  no  hardware  assist,  all  functions   including
       single-step are implemented in the MON96 firmware. MON96 communicates
       with  the  user  via  the  internal   serial   port   of   the   8096
       microcontroller,  although the  RDCHR  and  WRCHR  subroutines  could
       easily be modified to support communications through an external UART
       device.

          MON96 requires 9 bytes of internal register file memory, and about
       54 bytes of external read/write memory.  The  monitor  code  occupies
       about 3700 bytes of ROM memory for the program. If MON96 is placed in
       an 4K  (2732 or compatable)  rom,  this will leave over 300 bytes  of
       space for user I/O routines.  The MON96 rom must be positioned in the
       8096 memory map so that it has control of the 8096 interrupt vectors.
       On the standard 8096, these vectors are at $2000.

          Except for the memory requirements listed above,  MON96  preserves
       the entire state of the processor when passing control back and forth
       to the user program. This allows the user program to operate as if it
       were running "standalone" without fear of conflicting with MON96.
    MON96                                                            Page: 2


    2. USING MON96

       2.1 Monitor Commands

             The following commands are implemented in the monitor:

               B <breakpoint#> <address>

                  Set breakpoint at specified address. Breakpoint is removed
                  if address is 0000.  There can be up to eight breakpoints,
                  which are referenced by the numbers 0-7.

               CR <register> <value>

                  Changes 8096 registers values:

                  P   - set Program counter
                  S   - set Stack pointer
                  F   - set processor Flags register

               DB

                  Displays the current breakpoint settings.

               DI <start>,<end>

                  Displays  memory  in  disassembly  format,   starting   at
                  indicated address.  If SPACE is entered for <end> address,
                  assumes  FFFF.  Disassembler  output   contains   address,
                  opcodes  bytes,  instruction  mnemonic,  and  operands  to
                  instruction.

               DM <start>,<end>

                  Displays memory, in HEX/ASCII dump format, starting at the
                  indicated  address.  If  a  SPACE  is  entered  for  <end>
                  address, assumes FFFF.

               DR

                  Displays the current values of the 8096 registers (PC,  SP
                  & FLAGS).

               E <address>

                  Edit's memory,  Address and contents are displayed,  Enter
                  TWO hex digits to change value.  Entering SPACE  skips  to
                  the next  location,  BACKSPACE  backups  to  the  previous
                  location. CARRIAGE RETURN terminates the edit command.

               FM <start>,<end> <value>

                  Fill's memory from <start> to <end> with the byte <value>.
    MON96                                                            Page: 3


               G <address>

                  Begins execution at the indicated address.  If a SPACE  is
                  entered instead of an address,  begins  execution  at  the
                  address in the 8096 program counter.

               L

                  Downloads data from the console  port,  which  may  be  in
                  either MOTOROLA or INTEL hex format.

                  If you accidently enter this command, you may enter either
                  'S9'  or ':00'  to signify a null download file and return
                  to the command prompt.

               S

                  Single-Stepps  one  instruction  from  the  current   8096
                  Program Counter address.  Disassembly of  the  instruction
                  stepped is displyed on the console.

               ?

                  Displays a short help summary of the commands.
    MON96                                                            Page: 4


       2.2 Display Output

             In order to maintain the maximum amount of data on the terminal
          screen during the debugging session,  MON96 has been  designed  to
          minimize the number of screen lines in any display.  All  commands
          which output only one line of data  (such as  'S'),  will do so on
          the same line on which the command is issued  (To the right of the
          command).

             For commands which output larger amounts of data (such as 'DI',
          'DM'),  pressing the SPACE key during the display  will  halt  the
          display on the next line. Each subsequent SPACE entered will cause
          one more line of data be displayed.  Pressing CARRIAGE RETURN will
          allow the display to continue at full speed.

             The escape key may be used to cancel command output, and return
          to the '*' prompt.

       2.3 Interrupts

             MON96 re-vectors all interrupts (except for SERIAL and TRAP) to
          the corresponding locations in the first page of user RAM.

             When debugging any program which uses  the  interrupt  vectors,
          simply origin it at the  beginning  of  user  RAM,  and  code  the
          interrupt handlers in exactly the same locations  (relative to the
          beginning of the  program)  as  you  would  if  the  program  were
          origined at location zero.

             When MON96 is active,  the serial interrupt  is  used  used  by
          MON96 to keeptrack of the state of the serial I/O device. When the
          user program is active,  MON96 re-directs the serial interrupt  to
          the user program,  using the corresponding vector from  the  first
          page of user RAM.

             The TRAP interrupt is used by MON96 to  implement  breakpoints.
          Whenever a  TRAP  is  encountered,  MON96  examines  its  internal
          breakpoint table to determine if it is a breakpoint.  If  a  match
          occurs, MON96 saves the CPU state,  issues a "breakpoint" message,
          and return to the command prompt.

             If a  TRAP  is  encountered  at  an  address  which  is  NOT  a
          breakpoint,  MON96 will re-direct the TRAP interrupt to  the  user
          program,  using the corresponding vector from the  first  page  of
          user RAM.
