### Terminology # address_space This refers to the range of memory locations and a set of registers. This can be the addresses available to the computer's processor, the disk drive's processor or a specific memory configuration of one of the mentioned processors. # register One of the following: program counter (PC), stack pointer (SP), accumulator (A), X register (X), or Y register (Y). # address A specific memory location in the range $0000 to $FFFF. # address_range Two addresses. If the second address is less than the first, the range is assumed to wraparound from $FFFF to $0000. Both addresses must be in the same address space. # address_opt_range An address or an address range. # label Fixme. # prompt The prompt has the format [x:y]. If x is -, memory reads from the monitor do not have side effects. Otherwise, x is S. The second part of the prompt, y, shows the default address space. # checkpoint The monitor has the ability to setup triggers that perform an action when a specified situation occurs. There are three types of checkpoints; breakpoints, tracepoints and watchpoints. # breakpoint A breakpoint is triggered based on the program counter. When it is triggered, the monitor is entered. # tracepoint Like breakpoints, a tracepoint is triggered based on the program counter. Instead of entering the monitor, the program counter is printed and execution continues. # watchpoint Watchpoints are triggered by a read and/or write to an address. When a watchpoint is triggered, the monitor is entered. # <...> A data type. # * zero or more occurrence # [...] An optional argument ### Monitor Commands ## Machine State Commands COMMAND: Go down a stackframe. ABBREVIATIONS: none SYNTAX: down [] FUNCTION: Nothing yet. Is this really useful? COMMAND: Dump/undump machine state. ABBREVIATIONS: none SYNTAX: dump/undump FUNCTION: Save and restore machine state. COMMAND: goto ABBREVIATIONS: none SYNTAX: goto
FUNCTION: Change the PC to address and continue execution. COMMAND: Display IO registers. ABBREVIATIONS: none SYNTAX: io FUNCTION: Nothing yet. Will display VIC/VIA/CIA/SID registers. COMMAND: Goto next instruction. ABBREVIATIONS: n SYNTAX: next [] FUNCTION: Advance to the next instruction. Subroutines are treated as a single instruction. COMMAND: registers ABBREVIATIONS: r SYNTAX: registers [ = [, = ]*] FUNCTION: This command allows displaying and setting the registers of the 6502 microprocessor. Valid register names are A, X, Y, PC and SP. COMMAND: return ABBREVIATIONS: none SYNTAX: return FUNCTION: This command continues the execution of the 6502 and returns to the monitor just before(after?) the next RTS or RTI is executed. COMMAND: Step through instructions. ABBREVIATIONS: z SYNTAX: step [] FUNCTION: Single step through instructions. An optional count allows stepping more than a single instruction at a time. COMMAND: Go up a stack frame. ABBREVIATIONS: none SYNTAX: up FUNCTION: Nothing yet. Is this really useful? ## Memory Commands COMMAND: Compare memory contents. ABBREVIATIONS: c SYNTAX: compare
FUNCTION: Compare memory from the source specified by the address range to the destination specified by the address. The regions may overlap. Any values that miscompare are displayed using the default displaytype. COMMAND: Fill memory contents. ABBREVIATIONS: f SYNTAX: fill FUNCTION: Fill memory in the specified address range with the data in . If the size of the address range is greater than the size of the data_list, the data_list is repeated. COMMAND: Hunt memory for data. ABBREVIATIONS: h SYNTAX: hunt FUNCTION: Hunt memory in the specified address range for the data in . If the data is found, the starting address of the match is displayed. The entire range is searched for all possible matches. COMMAND: Interpret memory data as PETSCII text. ABBREVIATIONS: none SYNTAX: i FUNCTION: Display memory contents as PETSCII text. COMMAND: display memory contents ABBREVIATIONS: none SYNTAX: m [data_type] [address_opt_range] FUNCTION: Display the contents of memory. If no datatype is given, the default is used. If only one address is specified, the length of data displayed is based on the datatype. If no addresses are given, the 'dot' address is used. COMMAND: display memory contents as character data ABBREVIATIONS: none SYNTAX: mc [data_type] [address_opt_range] FUNCTION: Display the contents of memory as character data. If only one address is specified, only one character is displayed. If no addresses are given, the 'dot' address is used. COMMAND: display memory contents as sprite data ABBREVIATIONS: none SYNTAX: ms [data_type] [address_opt_range] FUNCTION: Display the contents of memory as sprite data. If only one address is specified, only one sprite is displayed. If no addresses are given, the 'dot' address is used. COMMAND: move memory contents ABBREVIATIONS: t SYNTAX: move address_range address SYNTAX: transfer address_range address FUNCTION: Move memory from the source specified by the address range to the destination specified by the address. The regions may overlap. COMMAND: Enter data. ABBREVIATIONS: none SYNTAX: > [address] FUNCTION: This displays the specified number in decimal, hex, octal and binary. ## Assembly Commands COMMAND: assemble ABBREVIATIONS: a SYNTAX: a
[ [: ]* ] FUNCTION: Assemble instructions to the specified address. If more than one instruction is given, the command does not cause the monitor to enter assembly mode. COMMAND: Disassemble instructions. ABBREVIATIONS: none SYNTAX: d [
[
]] FUNCTION: Disassemble instructions. If two addresses are specified, they are used as a start and end address. If only one is specified, it is treated as the start address and a default number of instructions are disassembled. If no addresses are specified, a default number of instructions are disassembled from the dot address. ## Checkpoint Commands COMMAND: set or list breakpoints ABBREVIATIONS: none SYNTAX: break [
[if ] ] FUNCTION: This command allows setting a breakpoint or listing the current breakpoints. If no address is given, the currently valid checkpoints are printed. If an address is given, a breakpoint is set for that address and the breakpoint number is printed. A conditional expression can also be specified for the breakpoint. For more information on conditions, see the CONDITION command. COMMAND: enable and disable checkpoints ABBREVIATIONS: none SYNTAX: enable/disable FUNCTION: Each checkpoint can be enabled or disabled. This command allows changing between these states. COMMAND: Set a command to execute on checkpoint. ABBREVIATIONS: none SYNTAX: command "" FUNCTION: When checkpoint check_num is hit, the specified command is executed by the monitor. Note that the 'x' command is not yet supported as a command argument. COMMAND: Add a condition to a checkpoint. ABBREVIATIONS: cond SYNTAX: condition if FUNCTION: Each time the specified checkpoint is examined, the condition is evaluated. If it evalutes to true, the checkpoint is activated. Otherwise, it is ignores. If registers are specified in the expression, the values used are those at the time the checkpoint is examined, not when the condition is set. TODO: Add memory dereferencing. COMMAND: Delete checkpoint. ABBREVIATIONS: del SYNTAX: delete FUNCTION: Delete the specified checkpoint. COMMAND: Ignore checkpoints. ABBREVIATIONS: none SYNTAX: ignore [] FUNCTION: This command allows ignoring a checkpoint a given number of crossings. If no count is given, the default value is 1. COMMAND: set or list tracepoints ABBREVIATIONS: none SYNTAX: trace [address [address]] FUNCTION: This command is similar to the break command except that it operates on tracepoints. A tracepoint differs from a breakpoint by not stopping execution but simply printing the PC, giving the user an execution trace. The second optional address can be used to specify the end of an range of addresses to be traced. COMMAND: set or list watchpoints ABBREVIATIONS: none SYNTAX: watch [address [address]] FUNCTION: This command is similar to the previous two commands except that it operates on watchpoints. A watchpoint differs from the others by stopping on a read and/or write to an address or range of addresses. If no addresses are given, a list of all the checkpoints is printed. ## General Commands COMMAND: Change directory. ABBREVIATIONS: none SYNTAX: cd FUNCTION: Change the working directory. COMMAND: Set the default device to read/write memory. ABBREVIATIONS: none SYNTAX: device [c:|d:] FUNCTION: Set the default memory device to either the computer or the disk. COMMAND: Change radix ABBREVIATIONS: none SYNTAX: radix [H|D|O|B] FUNCTION: This command sets the default radix to hex, decimal, octal, or binary. With no argument, the current radix is printed. COMMAND: sidefx ABBREVIATIONS: none SYNTAX: sidefx [on|off|toggle] FUNCTION: This command controls how monitor generated reads affect memory locations that have read side-effects. If the argument is 'on' then reads may cause side-effects. If the argument is 'off' then reads don't cause side-effects. If the argument is 'toggle' then the current mode is switched. No argument displays the current state. COMMAND: Execute system command. ABBREVIATIONS: sys SYNTAX: system FUNCTION: Nothing yet. ## Disk Commands COMMAND: block read ABBREVIATIONS: none SYNTAX: br [
] FUNCTION: This command reads the block at the specified track and sector. If an address is specified, the data is loaded into memory. If no address is given, the data is displayed on the screen using the default datatype. COMMAND: block write ABBREVIATIONS: none SYNTAX: bw
FUNCTION: This command writes a block of data at address to the specified track and sector. COMMAND: Disk command. ABBREVIATIONS: none SYNTAX: @ FUNCTION: Perform a disk command on the currently attached disk image. The specified disk command is sent to the drive's channel #15. TODO: Allow drives other than 8, and support for GCR images. COMMAND: Load file. ABBREVIATIONS: l SYNTAX: load ""
FUNCTION: Load the specified file into memory at the specified address. TODO: Allow no address? Load file from .d64, not FS. COMMAND: Save file. ABBREVIATIONS: s SYNTAX: save "" FUNCTION: Save the memory from address1 to address2 to the specified file. TODO: Save to .d64 instead of FS. COMMAND: Verify a file. ABBREVIATIONS: v SYNTAX: v ""
FUNCTION: Nothing yet. Is this really needed? ## Command File Commands COMMAND: Playback commands from file. ABBREVIATIONS: pb SYNTAX: playback "" FUNCTION: Monitor commands from the specified file are read and executed. This command stops at the end of file or when a STOP command is read. COMMAND: Record commands ABBREVIATIONS: rec SYNTAX: record "" FUNCTION: After this command, all commands entered are written to the specified file until the STOP command is entered. TODO: Don't enter bad commands. COMMAND: Stop recording commands. ABBREVIATIONS: none SYNTAX: stop FUNCTION: Stop recording commands. See RECORD. ## Label Commands COMMAND: add_label ABBREVIATIONS: al SYNTAX: add_label