All commands and data must be typed in upper case. If you type anything incorrectly, TANBUG will display a "?" at the end of the line.
M - Memory examine/modify
Displays the content of a specified memory location and allows you to change it.
Where ADDRESS is the address if the memory to display/change.
The current content is displayed after the address. If you want to change it, type the new value. Pressing ENTER will store the new value (if there is one) and exit. Pressing Ctrl-ENTER (this was a single key on the Microtan keyboard - LF) stores the new value and opens up the next location. ESC stores the new value and opens up the previous location.
L - List memory
Displays the contents of a section of memory.
L<ADDRESS>,<NUMBER OF LINES>
Where ADDRESS is the first address to be displayed and NUMBER OF LINES is the number of eight bytes lines to display.
Each line displayed comprises the address of the first byte on the line followed by eight bytes of data.
G - Go
Starts execution of a program.
Where ADDRESS is the address of the program start. The program will execute until either a BRK instruction is executed, or the Microtan is reset.
R - CPU register display/modify
Memory locations 0015-001B are used to hold the contents of the CPU registers. The CPU registers are loaded from these locations when you execute a program with the G command, and are stored there when a BRK instruction is executed, prior to the system returning to TANBUG. The R command simply performs a M0015 command to allow you to display and modify the CPU registers.
S - Enable single instruction mode
When single instruction mode is enabled, your program will execute one instruction at a time. The CPU registers will be displayed after each instruction.
N - Normal mode (disable single instruction mode)
This mode is also automatically set when the CPU is reset.
P - Proceed
Executes the next instruction. If you follow the P command with a number, that number of instructions will be executed.
B - Set/clear breakpoint
When ADDRESS is the address at which to set the breakpoint. BREAKPOINT NUMBER is from 0 to 7 and is the ID number of the breakpoint. To clear a breakpoint, set its address to zero. Used on its own, the B command will clear all breakpoints.
NOTE: This command works by replacing the instructions at the breakpoint addresses with BRK instructions when you execute your program. When your program hits a BRK and returns to TANBUG, all the breakpoint BRK instructions are replaced by their original values. So:
1. A breakpoint should only be set at the op-code part of
O - Calculate branch offset
Calculates the offset required for a branch instruction
O<BRANCH OPCODE ADDRESS>,<BRANCH DESTINATION ADDRESS>
Where BRANCH OPCODE ADDRESS is the address of the opcode of the branch instruction and BRANCH DESTINATION ADDRESS is the address where the branch is to jump to.
C - Copy memory
Copies a block of memory.
C<SOURCE START ADDRESS>,<SOURCE END ADDRESS>,<DESTINATION START ADDRESS>
Where SOURCE START ADDRESS is the start address of the source block, SOURCE END ADDRESS is the end address of the source bock (this address is included in the copy) and DESTINATION START ADDRESS is the start address of the destination.
Note that this command always copies from the start to the end and, so if the destination start address is within the source block, the block will be corrupted.
T - Translate assembler to machine code
Begin using the single line assembler.
Where ADDRESS is the address at which to begin assembling. The display will show the address followed by the byte currently stored at this address and the input cursor (which has changed to an exclamation mark). You may now enter a line of 6502 assembler, followed by ENTER.
Each assembler line consists of a three letter mnemonic and, if there is an operand, a space followed by the operand. All letters must be in upper case, and hexadecimal values must be preceded by a dollar "$". You can enter a single character as operand data by preceding the character with an apostrophe '. Labels cannot be used. The immediate operator is a "#".
When you have entered a valid line of assembler, the machine code will be shown after the address, and the ASCII equivalent on the right. The address will automatically increment.
If you enter an invalid line, a question mark will be shown and the address will not change.
Pressing caret "^", will cause the address to decrement by one and Ctrl-ENTER causes the address to increment by one.
You may change the address by entering *=$<ADDRESS>
Data may be directly entered by typing $<HEX BYTE> or '<CHARACTER>
When you have finished, press ESC.
An example is shown below:
I - Interpret (disassemble) machine code as assembler
Disassemble a section of memory.
Where ADDRESS is the address at which to begin disassembling.
The display will show fifteen lines of disassembly and stop. You may new press:
ENTER - display the next fifteen lines
BAS - Start BASIC interpreter
This starts the BASIC interpreter. You can also type GE2ED, which does the same thing.