Home Page

DB11 Manual




db11(1)                                                   db11(1)


NAME
       db11  -  Load and debug programs on Motorola 68HC11 micro­
       processor

SYNOPSIS
       db11 [-cfjmnrst] [scriptfile...]

DESCRIPTION
       db11 loads  programs,  performs  terminal  emulation,  and
       implements  a remote debugger for a Motorola 68HC11 micro­
       processor.

       It can load programs from  S19  files  into  EPROM/OTPROM,
       EEPROM, internal or external RAM, and will shortly support
       FLASH programming as well.

       Terminal emulation modes  include  direct  or  hexadecimal
       output  and/or input (with or without local echo) and MIDI
       (Music Instrument Digital Interface) protocol  interpreta­
       tion  into  readable text. Options may be changed interac­
       tively during a session.

       As a debugger, db11 communicates through a small  "talker"
       program to implement memory read and examine, breakpoints,
       single stepping, and  code  disassembly.   db11  is  fully
       scriptable  -  all commands and commandline options may be
       embedded in scripts.

   OPTIONS
       Command line options may occur  in  any  order,  but  boot
       (-b),  jump  (-j),  scriptfiles,  and connect (-c) will be
       executed in that order after any other options have  taken
       effect.

       -c baudrate
              Set  the  connect  baud rate. May be different from
              the  bootstrap  baud  rate.   Same  as  the  script
              instructions baud followed by connect.

       -f     Connect  even  if  the  bootload  or  other startup
              options seem to have failed.   Same  as  the  force
              script instruction.

       -j addr
              Bootload  a jump to the specified address.  Same as
              the jump script instruction.

       -m mode
              Set  specified  mode.   Same  as  the  mode  script
              instruction.

       -n     Display  bootup  actions  but  don't  perform them.
              Same as the pretend script instruction.




Copyright 2000 Clifford Heath                                   1





db11(1)                                                   db11(1)


       -r baudrate
              Set the bootup baud rate (often 1200, depending  on
              CPU  speed).   Same as the bootbaud script instruc­
              tion.

       -s file.s19
              Load the specified S19 file into memory.   Same  as
              the boot script instruction.

       -t tty The  MC68HC11 is attached to tty (or /dev/, or
              /dev/tty).  Same as the  tty  script  instruc­
              tion.

       -?     Print a command-line usage message only.

   MODES
       Modes  are  flags that affect the way other features work.
       Additionally, the debug flag connects you to the  debugger
       rather than directly to the MC68HC11. Mode keywords may be
       abbreviated to one  character,  as  shown  by  the  square
       brackets below, and are case-insensitive.

       d[ebug]
              Debug mode. Should only be activated after starting
              the talker program.

       e[cho] Local echo mode. Keystrokes in connect mode will be
              echoed  locally, perhaps because the program is not
              echoing them. Local echo always applies to Hexadec­
              imal input mode regardless.

       i[nputhex]
              Hexadecimal  input  mode. Two digits of hexadecimal
              data must be typed to define each byte of  data  to
              be sent to the MC68HC11.

       h[ex]  Hexadecimal output mode. All data received from the
              MC68HC11 will be displayed as  hexadecimal,  binary
              and, if printable, ASCII.

       m[idi] MIDI  interpret  mode.  The  data received from the
              MC68HC11 is expected to be  valid  MIDI  data,  and
              will be interpreted into readable ASCII.

       q[uiet]
              Be less talkative.

   CHANGING MODES WHILE CONNECTED
       Modes  may  be changed while connected by typing ~ after a
       newline. This displays a command prompt, and the following
       commands are available:

       e      Toggle local echo




Copyright 2000 Clifford Heath                                   2





db11(1)                                                   db11(1)


       hi     Toggle hex input mode

       ho     Toggle hex output mode

       m      Toggle MIDI mode

       ~      Send a tilde

       q      quit the program.

   STARTING THE DEBUGGER
       To  debug,  you  should either jump (or -j) to a preloaded
       talker program, or boot the RAM-based talker using the  -s
       command-line  option  or  the boot script command. The RAM
       talker is shipped as talker.s19.

   DEBUG COMMANDS
       Most debug commands can be abbreviated from  long-form  to
       short-form, as shown by square brackets in the list below.
       Commands are case-independent.  Addresses may  be  entered
       in  decimal, octal (with preceeding digit 0), or hexadeci­
       mal (preceeded by 0x), as in the C language. Multiple com­
       mands  may  specified  on  one line, separated by ; (semi­
       colon). The # character causes the remainder of  the  line
       to be ignored; this is useful in script files.

       b[reak]
              List all breakpoints.

       b[reak] addr
              Set  breakpoint at address.  Address may be . which
              means current program  counter.   It  is  perfectly
              valid  to  have  multiple  breakpoints  at the same
              address, but only the lowest numbered  enabled  one
              will be acknowledged.

       c[ontinue]
              Run  or continue the program from the current loca­
              tion (pc).  This enters  db11's  connect  mode,  so
              normal connect mode commands are available.  Beware
              however that if your program sends control-C,  DB11
              will  think  that a breakpoint has been hit because
              that's the alert character. There is so far no  way
              to change the alert character.

       d[isable] [num]
              Disable specified breakpoint or all breakpoints.

       e[nable] [num]
              Enable specified breakpoint or all breakpoints.

       f[ile] file
              Load  an S19 file into memory. This doesn't set the
              program counter pc to the entry point specified  in



Copyright 2000 Clifford Heath                                   3





db11(1)                                                   db11(1)


              the  file;  you  must do that using the set pc com­
              mand.

       g[et] [addr][,count|-addr2]
              Display memory in hex and  ASCII.  With  no  count,
              displays 16 bytes.

       include scriptfile
              Process  commands  from scriptfile. This command is
              also available when the debugger is not active.

       l[ist] [addr][,count]
              Disassemble code.  The  count  specifies  how  many
              bytes of code to disassemble, not how many instruc­
              tions. If the addr-addr2 form is used,  disassemble
              code in that address range.

       n[ext] Execute next instruction.

       o[ver] Next, but step over a subroutine call.

       q[uit] Quit db11.

       r[eg]  Display current register frame.

       s[et] [a|b|ccr|d|pc|sp|x|y|*addr]=value
              Set  register  or  memory. When setting memory, the
              value may end in w, which indicates that  a  2-byte
              value  is  to  be written even if the value fits in
              one byte. Setting the pc is like  an  unconditional
              branch;  it  specifies from where the next instruc­
              tion will be fetched. Setting the stack pointer  sp
              is special, as the other registers are fetched from
              an interrupt frame at the stack location, so chang­
              ing  the stack pointer changes all the other regis­
              ters also. This is not a feature for beginners!

       z[ero] [addr][,count|-addr2]
              Zero memory. With no count, zeroes one byte.

   EXAMPLES
       Here is a script file example:
              #
              # This db11 script sets baud rates etc,
              # loads and starts the talker, then issues
              # a disassemble command that disassembles
              # the BOOT ROM.
              #

              bootbaud 2400
              baud 19200
              tty S1
              boot talker.s19
              mode d



Copyright 2000 Clifford Heath                                   4





db11(1)                                                   db11(1)


              list 0xbf00-0xbfff
              quit























































Copyright 2000 Clifford Heath                                   5



Clifford's Home Page