TEDMON

From C64-Wiki
Jump to navigationJump to search
TEDMON on a C128.

BASIC version BASIC 3.5 was the first to integrate a machine code monitor called TEDMON, launched by the BASIC commands MONITOR or SYS 1024. TEDMON is embedded in the home computer systems C16/116, C128/D/DCR and Plus/4.

The monitor is also called using the BREAK vector if the CPU encounters the BRK opcode. This kind of entry will be shown in the register display preceded with line stating BREAK. This can be used on the one hand as an entry from BASIC via SYS command (to any address containing zero) or on the other hand for debugging purposes. The monitor does not provide any special commands for breakpoints or step-by-step command processing. This can be done manually by temporarily patching a BRK opcode to the appropriate code section.

Register Display[edit | edit source]

On entry of the monitor the following message is shown:

BASIC 3.5 (C16)
    PC SR AC XR YR SP
; 0004 30 00 00 00 F6
BASIC 7.0 (C128)
    PC  SR AC XR YR SP
; FB000 00 00 00 00 F8

The first line states the CPU registers and the second one shows their current contents.

The abbreviations in the register line have following meaning:

All values, numbers and addresses are shown and processed in hexadecimal notation.

Commands[edit | edit source]

TEDMON on the Plus/4.
TEDMON on the C128 (80 char mode).

The following commands can used:

  • A - Assemble a mnemonics line into machine code.
    • A <address> <command> [<operand>]
  • C - Compare two memory areas and display the difference.
    • C <start address> <end address> <start address for comparison>
  • D - Disassemble a machine code line into mnemonics.
    • D [<start address > [<end address>]]
  • F - Fill up a memory area with the given byte.
    • F <start address> <end address> <Byte>
  • G - Go to the memory address, also start a machine code program at the input memory address.
    • G <address>
  • H - Hunt a memory area - Search through a memory area for a certain value and show all memory locations found.
    • H <start address> <end address> (data are multiple hexadecimal numbers separated with empty spaces and strings separated with the apostrophe prefix ')
  • J - Only C128: Jump to subroutine - start a machine code program at the memory address. Similar to G, however when the processor hits an RTS, control returns to the monitor.
    • J <address>
  • L - Load a file from disk or datasette into the memory.
  • M - Memory is shown in hexadecimal numbers and values.
    • M [<start address> [<end address>]] (without an address the first 12 lines are shown)
  • R - Registers is shown again.
  • S - Save the input memory area into a file on disk or datasette.
    • S "<file iname>",<device number>,<start address>,<end address+1>
  • T - Transfer) or copy a memory area into another.
    • T <start address> <end address> <destination address>
  • V - Verify a saved file on disk or datasette with the memory area.
    • V "<file name>",<device number ($1-$F)>,<start address at C128>
  • X - eXit TEDMON into BASIC direct mode.
  • > - Modify up to eight bytes at a memory address (after M command).
    • > <address> <byte1> <byte2> ... <byte8>
  • . - Same as the A command.
  • ; - Change the register contents (after R command).
  • @ - Only C128: Displays the disk drive status or for using floppy commands.
    • @[device number ($8-$F)][,[ floppy command ]]
      Standard device number is 8.

TEDMON has no input prompt! Only a blinking cursor on the screen's leftmost column shows that the machine code monitor is ready for input.
If a wrong input is given (unknown command) a question mark (?) appears.

Number Base[edit | edit source]

The C128 version of TEDMON several numerical systems (number bases) can be selected by using the according prefix. Normally numbers are always in hexadecimal notation. Following prefixes exist: