home *** CD-ROM | disk | FTP | other *** search
- AMYX DEBUG INSTRUCTIONS
-
-
- GENERAL
-
- AMYX DEBUG is a debugger for Z80 CP/M that lets you examine and
- modify the contents of both the CPU registers and memory, search
- memory for specified contents, set breakpoints at specified pro-
- gram addresses, and single-step through a program. You can also
- perform hexadecimal addition and subtraction while DEBUG is ac-
- tive without affecting either DEBUG or the program being tested.
-
- Approximately 3000 bytes long, DEBUG is completely relocatable,
- with its highest relocated address determined by the equate REL-
- TOP. If you want to change the location of DEBUG in memory, set
- RELTOP as you wish and reassemble.
-
- If you are making your first excursions into using a debugger for
- assembly programs, you should be aware that while a debugger is a
- powerful tool for program testing, it also has the potential to
- cause disaster. With DEBUG, you can absolutely cream your pro-
- gram, DEBUG itself, and the operating system. If you are at all
- uncertain about what you're doing, be sure that you have a cur-
- rent backup copy of the program you're testing, and, for your
- first few attempts, you might want to leave the diskette drive
- doors open if your program will allow.
-
-
- LOADING DEBUG
-
- To load DEBUG into memory, type DEBUG <CR>. DEBUG will load and
- automatically relocate to high memory, then print a confirming
- message on the screen. You should reload DEBUG any time you
- leave it to modify your source code or run any other program.
-
-
- INVOKING DEBUG
-
- DEBUG is invoked by inserting the one-byte instruction RST 38H
- into the program being tested where you want DEBUG to become ac-
- tive. Once you are in DEBUG, you can set and clear breakpoints
- as you wish without affecting the program addresses. If you
- think you will want to change the place where you initiate DEBUG,
- place NOPs in your code where you want the other calls to be.
- You can then exchange any NOP for an RST 38H without affecting
- subsequent addresses.
-
-
- THE DISPLAY
-
- The upper portion of the display shows the contents of the Z80
- registers as indicated. The hex numbers to the right of the
- register contents (to the right of the ->) are the contents of
- the memory address in the register and the contents of the fif-
- teen next higher addresses. To the right of the hex display are
- the ASCII representations of the hex values. Hex values below 20
- (space) and above 7E (tilde) are shown as periods.
-
- The eight characters to the right of the AF and AF' registers
- show the status of the flags in the F(lag) register. A dash in-
- dicates a 0 in the F register (no flag set); a letter indicates a
- 1 (flag set), as follows:
-
- S (bit 7) Sign
- Z (bit 6) Zero
- x (bit 5) unused
- H (bit 4) Half-carry
- x (bit 3) unused
- P (bit 2) Parity/Overflow
- N (bit 1) Negative
- C (bit 0) Carry
-
- (See a Z80 reference book for a full explanation of how the flags
- are used and how to interpret their status.)
-
- The lower portion of the display shows the contents of one 128-
- byte page of memory.
-
- The line labeled "Breakpoints:" below the memory display shows
- the addresses of breakpoints that are set. 0000 means no break-
- point is set.
-
- The last line of the display is used for command entry and error
- messages.
-
-
- IMMEDIATE COMMANDS
-
- Immediate commands are single-character commands that are acted
- upon as soon as their key is pressed. Immediate command Q, can-
- cel command being entered, in always active. All other immediate
- commands are active only when no other command is in progress.
-
-
- Q Cancel (Quit) command being entered
-
- Cancels the command being entered, blanks the command line, and
- returns the Command? prompt. Immediate command Q is always
- active.
-
-
- + Page memory display forward
-
- Moves the page of memory on display forward 128 bytes. (The +/=
- key invokes the command; it's not necessary to shift up for the
- +.)
-
- - Page memory display backward
-
- Moves the page of memory on display back 128 bytes.
-
-
- G Continue from breakpoint (Go)
-
- Continues user program execution beginning at the PC on display.
-
-
- O Single-step
-
- Executes the instruction located at the PC on display, then re-
- turns to DEBUG. All CALLs are executed in full. Single-step
- preempts use of the first breakpoint address.
-
-
- Z Clear (Zero) all breakpoints
-
- Clears all set breakpoints. An available breakpoint is indicated
- by 0000 in the breakpoint display.
-
-
-
- REGULAR COMMANDS
-
-
- Regular commands require the entry of some kind of data, and are
- not acted upon until the carriage return is pressed. A command
- being entered can be cancelled at any time by using the immediate
- command Q.
-
- All addresses or byte values must be specified in hexadecimal,
- and all hex digits must be entered. Spaces between elements in
- regular commands may be used optionally. The backspace key may
- also be used.
-
- Command entry error checking is made as follows:
-
- Commands are checked for a maximum length of 32 bytes. If the
- maximum length is exceeded, the keyboard beeps and the character
- is ignored.
-
- The first letter of any command is tested to be sure it is a val-
- id command.
-
- All characters are tested to be sure they are valid in the com-
- mand string: hex numbers, register indentifiers, +/- arithmetic
- operators, and the terminating period.
-
- If an incorrect character is entered, the keyboard beeps and the
- character is ignored.
-
- Command execution error checking is made as follows:
-
- Each command is tested to be sure that the correct number of
- characters is present (so that you don't miss a byte and inadver-
- tently enter an unreasonable address).
-
- Command execution errors are indicated by a keyboard beep and the
- message "BAD COMMAND!" to the right of the command. The error
- message is held for about three seconds, then the command line is
- blanked and the "Command?" prompt is returned.
-
- While this level of error checking is by no means foolproof, its
- intent is to try to be reasonably sure that typographic errors
- won't lead to disaster.
-
-
- B AAAA
-
- Set breakpoint at address AAAA. The breakpoint is set in the us-
- er program code and the address is shown on the breakpoint dis-
- play. A breakpoint can be set only if there is space for it
- (0000 in the breakpoint display); a maximum of six breakpoints
- are allowed. Trying to set a breakpoint when there is no space
- will result in a keyboard beep and the message BREAKPOINTS FULL!
- Breakpoints remain set until specifically cancelled by the F or Z
- commands, or until DEBUG is reloaded.
-
-
- D AAAA
-
- Display memory at address AAAA. The page of memory on display is
- updated to show AAAA. Note that AAAA is placed near the middle
- of the memory page display so that memory contents below as well
- as above AAAA are shown.
-
-
- F AAAA
-
- Clear (Fix) the breakpoint at AAAA. The breakpoint at AAAA is
- repaired and the breakpoint display is updated to show an avail-
- able (0000) breakpoint. Trying to clear a nonexistent breakpoint
- will result in a BAD COMMAND message.
-
-
- H BBBB +/- BBBB
-
- Perform hexadecimal addition or subtraction. The arithmetic
- takes place as indicated, and the answer remains on display until
- any key is pressed.
-
-
- J AAAA
-
- Jump to address AAAA. User program execution is recommenced at
- address AAAA.
-
-
- L SSSS EEEE BB
-
- Fill (Load) memory with byte BB starting at address SSSS and end-
- ing at address EEEE. Display does not change.
-
-
- M AAAA BB
-
- Modify the contents of address AAAA to byte BB. After the ini-
- tial command entry, the memory page display is changed to show
- AAAA (as with the command D). The entry prompt then changes to
-
- Modify: AAAA
-
- where AAAA is the next address; you enter only the new byte val-
- ue. The memory page display is updated as each byte is entered.
- This entry loop continues until the Modify command is terminated
- by entering a period in place of BB.
-
-
- R RP BBBB
-
- Replace the contents of register pair RP with bytes BBBB. The
- register pairs are specified as follows:
-
- Regular registers: AF BC DE HL IX IY SP PC
- Prime registers: A' B' D' H'
-
- The display is rewritten upon entry of new register pair
- contents.
-
-
- S SSSS EEEE BBBBBBBB.
-
- Search memory for string BBBBBBBB starting at address SSSS and
- ending at address EEEE. The length of the search string is lim-
- ited by the length of the command buffer (32 characters), so its
- maximum length is 11 bytes. The search string must be terminated
- by a period (no period will result in a BAD COMMAND! message).
- When the string is found, the memory page on display is changed
- to show the find address. If the string is not found, the key-
- board will beep and the message STRING NOT FOUND will be dis-
- played in the error message location.
-
-
- S.
-
- Recommence search starting at the address immediately following
- the last find and continuing on to address EEEE. (S. cannot be
- used if any other command has been issued following the initia-
- tion of a search.)
-
- T SSSS EEEE DDDD
-
- Move (Transfer) the memory contents starting at address SSSS and
- ending at address EEEE to destination DDDD. The display does not
- change.
-
-
- ###
-