![]() |
ADD Debugger Quick Start |
![]() |
Each window can be in active state (pic.1) or in inactive state (pic.2). The
main difference is shown during continuous update of windows contents when the simulated code
is running. Inactive windows (marked with ) don't then update but
active windows (marked with ) do. After executing only one
instruction in step-by-step mode, all of the windows (active or not) are updated. Making
window inactive greatly improves performance of simulation, you can do it especially with
windows you don't temporarily use. Switch actual window state by double clicking its caption.
Every window has its number in chain, calculated after creating new windows or changing their active/inactive behavior. This number is shown on the left of the window caption, just after the activation mark ( or ). As you can
see in any application running under MS Windows 95, every window also has the minimize
button: and the close button: , You may feel lack of
the close button while running debugger in older windows environments (like MS Windows 3.1 or
3.11) but you can always close your windows by double clicking their activation marks.
|
![]() pic.1 ![]() pic.2 |
![]() pic.3 |
The main window type you will work with is the 'Code' window (pic.3). It displays the
contents of the simulated EPROM memory. In every row of its listbox it shows the label
(an address symbol name, if given) in red, the current instruction address (hexadecimal),
instruction opcode bytes (in hex too) and in the last two columns - instruction mnemonic and
arguments (if any). Near the right border of the 'Code' window there is a scrollbar which can
be used to move view between parts of code. Click the up arrow button:
to move one line up, the down arrow button: to move one line down. Drag
the scroller box: (the box residing in a space between two arrows in a
scrollbar) to move freely in whole code memory area or click in blank space between arrow
buttons and the scroller box to move one page up or down.
To change existing label (red text on the left side of the 'Code' window) or define new one, use the 'Symbol Table' window mentioned lately in this document. You can start assembling mode by double clicking on the desired line in the listbox, where you want to put new piece of code. Pressing ENTER when the 'Code' window is selected will do the same. The assembling window appears and you should write a complete instruction there, for example: MOV A,@R0. You can freely use symbol names defined in the 'Symbol Table' (in EPROM section) for jump and call addresses, for example: ACALL MYNEARPROC, the given label will be converted to hexadecimal address and then put within assembled code. After this operation the assembling pointer is incremented and the assembling window appears once again. When you'll decide it's time to end the assembling mode, just press ESC or close the window with a mouse. If you will make a mistake and write bad instruction mnemonic (or just press ENTER with line box empty), the assembling window will be automatically closed too. To write pure data bytes (not instruction mnemonics) into EPROM memory region, type only: DB in the assembling dialog box - then the new window will be displayed and there you can put anything you want, including hex numbers and text strings, just like you can do it in 'EPROM Memory' window mentioned lately in this document. Read the instructions enclosed there to find out what you can write to EPROM memory region. There is one button more: located on the right side of the 'Code'
window, under the down arrow of the scrollbar - click it to move instruction view where you
want, just input an address in the new dialog window shown. Instead of providing new address
in the dialog window you can write: PC - the view will be moved to
the actual position of the Program Counter. You can do the same action by pressing
Ctrl-O combination - you'll be moved to the actual PC position in the last
focused 'Code' window.
|
![]() pic.4 |
The next important window type is designed for displaying simulated system memory contents and
is called differently: 'EPROM Memory', 'External RAM' or 'Internal RAM'
(pic.4) - depending on what memory contents you can examine there. Each of them is
constructed from four items - the main view area, horizontal scrollbar, vertical scrollbar
and the well-known button: in the right bottom corner. By clicking this
button you can move actual byte pointer within the memory area - just provide new address (in
hex) in next dialog window displayed. When working with an 'EPROM Memory' window you
can write "PC" and be moved to the actual Program Counter position. There are 64
kB of simulated EPROM memory, the same amount of External RAM and up to 256 bytes of Internal
RAM. The Debugger itself has two modes of operation: 8051-style (when you have 128 bytes of
Internal RAM and 128 bytes for Special Function Registers area - and both of these
areas are displayed in the window) and 8052-style (you then have 256 bytes of Internal RAM and
they are displayed within this window, SFR area is not displayed but it exists as usual
and is used as usual).
Horizontal and vertical scrollbars lying on bottom and right edges of the window are designed for moving the actual byte pointer within the memory area - from 0 to FFFF (hex) for EPROM and External RAM contents or from 0 to FF (hex) for Internal RAM. The main view area of the window displays (from the left): hexadecimal address each data row begins at, 8 data bytes (in hex, too) and then these 8 data bytes written as characters. You can click on a hex data byte in the window to move the actual byte pointer to that byte address. To begin providing new data just double click on the desired new byte position. Write anything you want in the dialog box displayed, you can use decimal numbers (numbers less than 256 will be converted to 1 data byte, less than 65536 to 2 data bytes in little endian order), hex numbers followed by letter 'H' (or small 'h') and even the strings (enclosed in apostrophes), provide comma between to separate them. For example: 231,78FCh,'bootup proc',0. The actual byte pointer will be automatically increased with the length of the string entered (in bytes). Every error will stop processing the rest of the entered line. If the string entered is longer than the remaining space in a simulated memory area, it will be wrapped to the beginning of the memory (from address 0). |
![]() pic.5 |
One of the most important windows in this debugger is called simply 'Registers' - as
you can see on pic.5. There are 28 register names (positioned in processor SFR
space) in this window with their contents shown as a hexadecimal 8-bit number. You can't
change fixed register names nor their positions within this window. To change the register
contents simply double click on the desired one and input new hex value. 'Registers'
window is continuously updated if active (in state). If you make this
window inactive (in |