31 User Manual Command Reference
David Banks edited this page 2020-01-31 20:19:47 +00:00

Table of Contents

Note: this manual describes the functionality of firmware version 0.981 (and later). If you have an earlier version, please consider updating.

Generic Commands

6502 specific commands

6809 specific commands

Z80 specific commands

Generic Commands

blist (bl)

List all break points and watch points.

Usage: bl

Example:

>> bl
0: 0080 mask FFF0: Mem Wr Watch (trigger: Always)
1: 8000 mask FFFF: Mem Wr Brkpt (trigger: ~T0 and ~T1)
2: B000 mask FFFC: Mem Rd Brkpt (trigger: Always)
3: FF3F mask FFFF: Ex Brkpt (trigger: Always)

Information includes:

  • a breakpoint number which can be used in the clear command to delete the breakpoint
  • the address of the breakpoint (in hex)
  • the address mask of the breakpoint (in hex)
  • the type(s) of the breakpoint (more below)
  • the trigger condition for the breakpoint (more below)

The following types of breakpoint / watchpoint exist:

  • Instruction Execute breakpoint
  • Memory Read breakpoint
  • Memory Write breakpoint
  • Instruction Execute watchpoint
  • Memory Read watchpoint
  • Memory Write watchpoint

Breakpoints cause the emulator to immediately switch back to command mode, and the target processor is paused.

Watchpoints are less intrusive; the emulator remains in running mode, and the processor continues execution without any interruption. An event will be written to the hardware event FIFO, which is then asynchronously. logged. The hardware event FIFO is only 512 words deep, and so injudicious use of watchpoints will result in overrun and lost events, as the serial console is much slower.

Multiple types of break point and watch points can be combined on the same address. For example, a memory read watchpoint might be combined with a memory write breakpoint. If there is any ambiguity, then a breakpoint will take precedence over a watch point of the same type.

Breakpoints and Watchpoints can optionally be qualified by a trigger code, which is a function of the two external trigger inputs:

Trigger Codes:
    0 = Never
    1 = ~T0 and ~T1
    2 = T0 and ~T1
    3 = ~T1
    4 = ~T0 and T1
    5 = ~T0
    6 = T0 xor T1
    7 = ~T0 or ~T1
    8 = T0 and T1
    9 = T0 xnor T1
    A = T0
    B = T0 or ~T1
    C = T1
    D = ~T0 or T1
    E = T0 or T1
    F = Always

This can be manipulated with the trig command.

breakr (breakr)

Sets a memory read breakpoint on an address, or range of addresses.

Usage: breakr <address> [ <address mask> [ <trigger condition> ] ]

This is triggered when the host memory read address ANDed with <address mask> matches <address>, and <trigger condition> is valid.

If <address mask> is omitted, it defaults to FFFF.

If <trigger condition> is omitted if defaults to F (trigger always).

breakw (breakw)

Sets a memory write breakpoint on an address, or range of addresses

Usage: breakw <address> [ <address mask> [ <trigger condition> ] ]

This is triggered when the host memory write address ANDed with <address mask> matches <address>, and <trigger condition> is valid.

If <address mask> is omitted, it defaults to FFFF.

If <trigger condition> is omitted if defaults to F (trigger always).

breakx (br)

Sets an instruction execute breakpoint on an address, or range of addresses

Usage: br <address> [ <address mask> [ <trigger condition> ] ]

This is triggered when the the address of an opcode fetch ANDed with <address mask> matches <address>, and <trigger condition> is valid.

If <address mask> is omitted, it defaults to FFFF.

If <trigger condition> is omitted if defaults to F (trigger always).

clear (cl)

Removes a breakpoint or watchpoint.

Usage: cl <number> | <address>

The clear command can be used in two ways:

  • with a number (e.g. 0-7) it will clear the breakpoint with this number as listed by bl
  • with an address (e.g. FF3F) it will clear the breakpoint with this number as listed by bl

When a breakpoint is removed from the middle of the list, the remaining breakpoints are shuffled up so there is no gap.

compare (com)

Compares one block of memory with another.

Usage: com <start> <end> <to>

<start> and <end> are inclusive.

Example:

>> cop 8000 80ff 4000
>> com 8000 80ff 4000
>> wr 4023 ff
Wr:  4023:FF  .
>> com 8000 80ff 4000
Compare failed: 8023:00  . /= 4023:FF  .
>> 

continue (c)

Resumes execution of the target code by switching the emulator back to running mode.

Usage: c [ <reset> ]

If is non-zero, then the reset line on the processor will be asserted for approx 100us before execution is resumed.

copy (cop)

Copies one block of memory to another.

Usage: com <start> <end> <to>

<start> and <end> are inclusive.

Example:

>> fill 4000 40ff aa
Wr: 4000 to 40FF = AA
>> m 4000
4000 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4010 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4020 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4030 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4040 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4050 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4060 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4070 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4080 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4090 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40A0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40B0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40C0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40D0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40E0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40F0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
>> copy 8000 807f 4000
>> m 4000  
4000 C9 01 F0 27 60 EA 60 0E 04 42 41 53 49 43 00 28  ...'`.`..BASIC.(
4010 43 29 31 39 38 34 20 41 63 6F 72 6E 0A 0D 00 00  C)1984 Acorn....
4020 80 00 00 00 03 27 01 0A 64 E8 10 25 11 05 0D 05  .....'..d..%....
4030 0E 05 0F 05 10 D0 0C A9 41 85 0D 49 13 85 0E 49  ........A..I...I
4040 05 85 0F A9 84 20 F4 FF 86 06 84 07 3A 20 F4 FF  ..... ......: ..
4050 84 18 64 1F 9C 02 04 9C 03 04 A2 FF 86 23 A2 0A  ..d..........#..
4060 8E 00 04 CA 8E 01 04 A9 78 8D 02 02 A9 B2 8D 03  ........x.......
4070 02 58 4C 2D 8F 84 39 A0 01 B1 37 A0 F6 C9 F2 F0  .XL-..9...7.....
4080 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4090 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40A0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40B0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40C0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40D0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40E0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40F0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................

This copies the first 128 bytes of the Acorn BBC Basic ROM from 0x8000 to 0x4000.

crc (crc)

Calculates a CRC over a block of host memory.

Usage: crc <start> <end>

<start> and <end> are inclusive.

The CRC polynomial is the standard "Acorn Atom" CRC-16 polynomial.

Example:

>> crc c000 cfff 
crc: D67D
>>

D67D is well-known in the Acorn Atom community as the CRC for Atom Basic.

dis (d)

Disassembles the next 10 instruction in host memory.

Usage: d [ <start> [ <end> ] ]

If <start> is omitted, the disassembly will continue from the end of the previous disassembly, if there was one, or the current value of the program counter register.

If <end> is omitted, the next 10 instructions will be disassembled.

Example:

>> d c2b2
C2B2 : LDA #29     
C2B4 : STA 12      
C2B6 : LDA #0D     
C2B8 : LDY 12      
C2BA : STY 0E      
C2BC : LDY #00     
C2BE : STY 0D      
C2C0 : STA (0D),Y  
C2C2 : LDA #FF     
C2C4 : INY         
>> d
C2C5 : STA (0D),Y  
C2C7 : INY         
C2C8 : STY 0D      
C2CA : LDA #08     
C2CC : STA 0321    
C2CF : LDA #3E     
C2D1 : CLD         
C2D2 : JSR CD0F    
C2D5 : LDX #01     
C2D7 : STX 06 

fill (fi)

Fills a block of host memory with a fixed value.

Usage: fill <start> <end> <data>

<start> and <end> are inclusive.

Example:

>> fi 8000 81ff 01
Wr: 8000 to 81FF = 01
>> 

This fills the Atom's screen memory with the character code for 'A'.

flush (f)

This flushes the event FIFO.

Usage: f

It's useful if the event FIFO contains unwanted events (for example, because it has overflowed, or an incorrect watchpoint was set).

help (he)

This displays the emulator name, version, build date and list of commands.

Usage: he [ <command> ]

Example:

>> he
ICE-65C02 In-Circuit Emulator version 0.983
Compiled at 16:13:16 on Jan 28 2020
8 watches/breakpoints implemented
Commands:
   blist    
   breakr   <address> [ <mask> [ <trigger> ] ]
   breakw   <address> [ <mask> [ <trigger> ] ]
   breakx   <address> [ <mask> [ <trigger> ] ]
   clear    <address>
   compare  <start> <end> <to>
   continue [ <reset> ]
   copy     <start> <end> <to>
   crc      <start> <end>
   dis      [ <start> [ <end> ] ]
   fill     <start> <end> <data>
   go       <address>
   exec     <op1> [ <op2> [ <op3> ] ]
   flush    
   help     [ <command> ]
   history  
   load     <address>
   mem      [ <address> ]
   mode     [ <value> ]
   next     
   rd       [ <address> [ <count> ] ]
   regs     
   reset    
   save     <start> <end>
   special  [ <value> ]
   srec     
   step     [ <instructions> ]
   test     <start> <end> [ <test num> ]
   trace    [ <instructions> ]
   trigger  [ <address> <trigger> ]
   watchr   <address> [ <mask> [ <trigger> ] ]
   watchw   <address> [ <mask> [ <trigger> ] ]
   watchx   <address> [ <mask> [ <trigger> ] ]
   wr       <address> <data> [ <count> ]
>> 

This lists all available commands, and their arguments.

Example:

>> he break
   breakx   <address> [ <mask> [ <trigger> ] ]

This lists the arguments for a single command.

history (h)

This lists the last 16 entries in the command history.

_Usage: h

Example:

>> h
[1] d 8000
[2] m 8000
[3] s
[4] h

It's possible to select one of the previous commands in the command history using the up and down cursor arrows. The command can also be edited in a limited fashion using backspace.

load (l)

This loads a block of binary data to a specified address in memory.

Usage: load <address>

The transfer starts when the first character is received.

The transfer ends when no character is received for 1 second.

To use this command, you need a terminal program that provides a Send RAW file feature.

Example:

>> fi 4000 40ff aa
Wr: 4000 to 40FF = AA
>> load 4000
Send file now...
Wrote 4000 to 4005
>> m 4000
4000 61 62 63 64 65 66 AA AA AA AA AA AA AA AA AA AA  abcdef..........
4010 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4020 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4030 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4040 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4050 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4060 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4070 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4080 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4090 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40A0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40B0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40C0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40D0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40E0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40F0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
>> 

mem (m)

Dumps a block 256 bytes of host memory in hex and ascii.

Usage: m [ <start address> ]

If the start address is omitted <start address>, the dump will continue from the end of the previous dump, if there was one, or the current value of the program counter register.

Example:

>> m fe00
FE00 71 FE B0 FB A0 10 84 E6 A0 20 20 66 FE B9 00 80  q........  f....
FE10 99 E0 7F C8 D0 F7 20 6B FE B9 00 81 99 E0 80 C8  ...... k........
FE20 D0 F7 A0 1F A9 20 91 DE 88 10 FB 60 69 20 85 DE  ..... .....`i ..
FE30 D0 02 E6 DF 60 88 10 19 A0 1F A5 DE D0 0B A6 DF  ....`...........
FE40 E0 80 D0 05 68 68 4C 65 FD E9 20 85 DE B0 02 C6  ....hhLe.. .....
FE50 DF 60 20 FB FE 08 48 D8 84 E5 86 E4 20 EA FC 68  .` ...H..... ..h
FE60 A6 E4 A4 E5 28 60 2C 02 B0 10 FB 2C 02 B0 30 FB  ....(`,....,..0.
FE70 60 A0 3B 18 A9 20 A2 0A 2C 01 B0 F0 08 EE 00 B0  `.;.. ..,.......
FE80 88 CA D0 F4 4A 08 48 AD 00 B0 29 F0 8D 00 B0 68  ....J.H...)....h
FE90 28 D0 E3 60 08 D8 86 E4 84 E5 2C 02 B0 50 05 20  (..`......,..P. 
FEA0 71 FE 90 F6 20 8A FB 20 71 FE B0 FB 20 71 FE B0  q... .. q... q..
FEB0 F6 98 A2 17 20 C5 FE BD E3 FE 85 E2 A9 FD 85 E3  .... ...........
FEC0 98 6C E2 00 CA DD CB FE 90 FA 60 00 08 09 0A 0B  .l........`.....
FED0 0C 0D 0E 0F 1E 7F 00 01 05 06 08 0E 0F 10 11 1C  ................
FEE0 20 21 3B 44 5C 38 62 87 69 40 8D 92 7D 50 DF D2   !;D\8b.i@..}P..
FEF0 9A A2 E2 AE C0 DF D8 D6 C8 C6 C2 48 C9 02 F0 27  ...........H...'
>> m
FF00 C9 03 F0 34 C5 FE F0 2E AD 0C B8 29 0E F0 27 68  ...4.......)..'h
FF10 2C 01 B8 30 FB 8D 01 B8 48 AD 0C B8 29 F0 09 0C  ,..0....H...)...
FF20 8D 0C B8 09 02 D0 0C A9 7F 8D 03 B8 AD 0C B8 29  ...............)
FF30 F0 09 0E 8D 0C B8 68 60 AD 0C B8 29 F0 B0 F4 A2  ......h`...)....
FF40 17 BD 9A FF 9D 04 02 CA 10 F7 9A 8A E8 86 EA 86  ................
FF50 E1 86 E7 A2 33 9D EB 02 CA 10 FA A9 0A 85 FE A9  ....3...........
FF60 8A 8D 03 B0 A9 07 8D 02 B0 2C 01 B0 50 11 AD FE  .........,..P...
FF70 BF 29 10 F0 0A A9 83 8D FE BF 6C FE 7F EA EA 20  .)........l.... 
FF80 D1 F7 06 0C 0F 41 43 4F 52 4E 20 41 54 4F 4D 0A  .....ACORN ATOM.
FF90 0A 0D EA 58 84 FD 4C 00 E0 EA 00 A0 EF F8 52 FE  ...X..L.......R.
FFA0 94 FE 6E F9 E5 FA AC C2 AC C2 EE FB 7C FC 38 FC  ..n.........|.8.
FFB0 78 C2 85 FF 68 48 29 10 D0 06 A5 FF 48 6C 04 02  x...hH).....Hl..
FFC0 A5 FF 28 08 6C 02 02 48 6C 00 02 6C 1A 02 6C 18  ..(.l..Hl..l..l.
FFD0 02 6C 16 02 6C 14 02 6C 12 02 6C 10 02 6C 0E 02  .l..l..l..l..l..
FFE0 6C 0C 02 6C 0A 02 20 E3 FF C9 0D D0 07 A9 0A 20  l..l.. ........ 
FFF0 F4 FF A9 0D 6C 08 02 6C 06 02 C7 FF 3F FF B2 FF  ....l..l....?...

next (n)

Sets a breakpoint on the next instruction, then continues execution of the current instruction.

Usage: n

This is useful when single stepping, to step over a subroutince call, or to exit a loop that uses a backwards branch.

The breakpoint is marked as transient, meaning it is automatically deleted when it is hit.

rd (rd)

Reads a single host memory address.

Usage: rd <address> [ <count> ]

The optional count parameter causes the operation to be repeated multiple times. If omitted, count defaults to 1.

Example:

>> rd b002
Rd: B002 = F7
>> 

regs (r)

Dumps the current values of the processor registers.

Usage: r

Example:

>> r
6502 Registers:
  A=04 X=01 Y=14 SP=00F6 PC=FE7B
  Status: NV-B----
>> 

reset (res)

Resets the processor.

Usage: res

Example:

>> res
Resetting CPU
00.000006: FF3F : LDX #17
>>

In this example, you can see the program counter is set to FF3F, which is the 6502 reset vector on the Acorn Atom.

save (sa)

Saves a block of binary data.

Usage: save <start> <end>

<start> and <end> are inclusive.

To use this command, you need a terminal program that provides a Receive RAW file feature (or alternatively, a log to file feature).

Example:

>> m 4000
4000 61 62 63 64 65 66 AA AA AA AA AA AA AA AA AA AA  abcdef..........
4010 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4020 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4030 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4040 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4050 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4060 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4070 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4080 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
4090 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40A0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40B0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40C0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40D0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40E0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
40F0 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA  ................
>> sa 4000 4005
Press any key to start transmission (and again at end)
abcdef
>> 

special (sp)

This command allows NMI and/or IRQ interrupts to be temporarily masked.

Usage: sp [ <value> ]

Legal values are:

  • 0 - enable NMI and enable INT/IRQ
  • 1 - enable NMI and disable INT/IRQ
  • 2 - disable NMI and enable INT/IRQ
  • 3 - disable NMI and disable INT/IRQ

If called without parameters, the current value is returned.

srec (sr)

Uploads srecords into memory

Usage: sr

There are no paramaters.

You should see a message: Send file now..

Only the S1 srecord is currently understood, e.g.:

<S1><Count><Addr><Data>...<Data><CRC>

Here's a specific example:

S123A0004C10A0A94E8D0802A9A08D09024C33A0A9468D0402A9A08D0502A90F8D04B8A9A9

The command completes if no records are received within a short time period.

The linux utility srec_cat can be used to convert an arbitrary file into suitable srecords:

% srec_cat somefile -binary -offset 0x1900 -data_only > somefile.srec

This will turn a binary file (somefile) into srecord format (solefile.srec), with a loading address in memory of 0x1900.

step (s)

Single steps one or more instructions.

Usage: s [ <number of instructions> ]

If <number of instructions> is omitted, one instruction will be stepped.

Example:

>> s 3
Stepping 3 instructions
00.000008: FF41 : LDA FF9A,X  
00.000012: FF44 : STA 0204,X  
00.000017: FF47 : DEX         
>> s
Stepping 3 instructions
00.000019: FF48 : BPL FF41    
00.000022: FF41 : LDA FF9A,X  
00.000026: FF44 : STA 0204,X  
>> 

The trace command affects the behaviour of step, by allowing the amount of logging to be reduced.

test (t)

The test command performs a destructive test of a block of host memory:

Usage: t <start address> <end address> [ <test mode> ]

The optional <test mode> (a decimal number!) can control the type of test:

  • values 0 to 255, test with fixed data
  • value -1, test with checkerboard pattern
  • value -2, test with inverse checkerboard pattern
  • value -3, test with address pattern
  • value -4, test with inverse address pattern
  • value -5, test with pseudo random data

If <test mode> is omitted, a standard suite of tests is run, as can be seen in the examples below.

Example:

>> t 8000 81ff
Memory test: Fixed 55: passed
Memory test: Fixed AA: passed
Memory test: Fixed FF: passed
Memory test: Fixed 00: passed
Memory test: Checkerboard: passed
Memory test: Inverse checkerboard: passed
Memory test: Address pattern: passed
Memory test: Inverse address pattern: passed
Memory test: Random: passed
Memory test: Random: passed
Memory test: Random: passed
>> test 8000 8100 -1
Memory test: Checkerboard: passed
>> test 8000 81ff -2
Memory test: Inverse checkerboard: passed
>> test 8000 81ff -3
Memory test: Address pattern: passed
>> test 8000 81ff -4
Memory test: Inverse address pattern: passed
>> test 8000 81ff -5
Memory test: Random: passed
>> t 8000 81ff 0
Memory test: Fixed 00: passed
>> t 8000 81ff 255
Memory test: Fixed FF: passed
>> t c000 c007 255
Fail at C000 (Wrote: FF, Read back 3C)
Fail at C001 (Wrote: FF, Read back 3D)
Fail at C002 (Wrote: FF, Read back 3E)
Fail at C003 (Wrote: FF, Read back FE)
Fail at C004 (Wrote: FF, Read back 2D)
Fail at C005 (Wrote: FF, Read back 2B)
Fail at C006 (Wrote: FF, Read back C8)
Fail at C007 (Wrote: FF, Read back 23)
Memory test: Fixed FF: failed: 8 errors

trace (tr)

Controls the frequency of instruction logging produced by the step command.

Usage: tr [ <number of instructions> ]

A value of zero will disable instruction logging.

Example:

>> tr 1
Tracing every 1 instructions while single stepping
>> s 10
Stepping 10 instructions
00.000073: FF47 : DEX         
00.000075: FF48 : BPL FF41    
00.000078: FF41 : LDA FF9A,X  
00.000082: FF44 : STA 0204,X  
00.000087: FF47 : DEX         
00.000089: FF48 : BPL FF41    
00.000092: FF41 : LDA FF9A,X  
00.000096: FF44 : STA 0204,X  
00.000101: FF47 : DEX         
00.000103: FF48 : BPL FF41    
>> tr 5
Tracing every 5 instructions while single stepping
>> s 10
Stepping 10 instructions
00.000120: FF41 : LDA FF9A,X  
00.000138: FF44 : STA 0204,X  
>> tr 0
Tracing disabled
>> s 10
Stepping 10 instructions
00.000173: FF48 : BPL FF41    
>>

trigger (tri)

Updates the trigger condition associated with the breakpoint/watchpoint.

Usage: tr [ <breakpoint number> <trigger condition> ]

Example:

>> break c2b2
Ex Brkpt set at C2B2
>> bl
0: C2B2 mask FFFF: Ex Brkpt (trigger: Always)
>> tri 0 0
>> bl
0: C2B2 mask FFFF: Ex Brkpt (trigger: Never)
>> tri 0 6
>> bl
0: C2B2 mask FFFF: Ex Brkpt (trigger: T0 xor T1)

Setting the trigger condition to 0 can be used to temporarily disable a breakpoint.

Omitting all the arguments lists the available trigger conditions.

Example:

>> tri
Trigger Codes:
    0 = Never
    1 = ~T0 and ~T1
    2 = T0 and ~T1
    3 = ~T1
    4 = ~T0 and T1
    5 = ~T0
    6 = T0 xor T1
    7 = ~T0 or ~T1
    8 = T0 and T1
    9 = T0 xnor T1
    A = T0
    B = T0 or ~T1
    C = T1
    D = ~T0 or T1
    E = T0 or T1
    F = Always
>> 

T0 and T1 refer to external trigger input pins on the GODIL.

watchr (watchr)

Sets a memory read watchpoint on an address, or range of addresses.

Usage: watchr <address> [ <address mask> [ <trigger condition> ] ]

This is triggered when the host memory read address ANDed with <address mask> matches <address>, and <trigger condition> is valid.

If <address mask> is omitted, it defaults to FFFF.

If <trigger condition> is omitted if defaults to F (trigger always).

watchw (watchw)

Sets a memory write watchpoint on an address, or range of addresses

Usage: watchw <address> [ <address mask> [ <trigger condition> ] ]

This is triggered when the host memory write address ANDed with <address mask> matches <address>, and <trigger condition> is valid.

If <address mask> is omitted, it defaults to FFFF.

If <trigger condition> is omitted if defaults to F (trigger always).

watchx (wa)

Sets an instruction execute watchpoint on an address, or range of addresses

Usage: watch <address> [ <address mask> [ <trigger condition> ] ]

This is triggered when the the address of an opcode fetch ANDed with <address mask> matches <address>, and <trigger condition> is valid.

If <address mask> is omitted, it defaults to FFFF.

If <trigger condition> is omitted if defaults to F (trigger always).

wr (wr)

Writes a single host memory address.

Usage: wr <address> <value> [ <count> ]

The optional count parameter causes the operation to be repeated multiple times. If omitted, count defaults to 1.

Example:

>> wr b002 e3
Wr: B002 = E3
>>

6502 specific commands

exec (e)

Executes an arbitrary 1, 2 or 3 byte instruction.

_Usage: e <op1> [ <op2> [ <op2> ] ]

This command should be considered experimental, as sometimes the results can be hard to understand.

When executing this command, the 6502 will initially be paused part way through the current instruction. That instruction is allowed to complete, then the specified instruction is injected, then a JMP instruction is executed to return the PC back to the original value.

Example:

13.615966 : E7D9 : 0A       : ASL A
>> r
6502 Registers:
  A=40 X=00 Y=0A SP=01F3 PC=E7D9
  Status: -------C
>> exec a2 aa
13.615975 : E7D9 : 0A       : ASL A
>> r
6502 Registers:
  A=80 X=AA Y=0A SP=01F3 PC=E7D9
  Status: N-------
>> exec a2 ff
13.615985 : E7D9 : 0A       : ASL A
>> r
6502 Registers:
  A=00 X=FF Y=0A SP=01F3 PC=E7D9
  Status: N------C
>> 

This example illustrates the potential pitfalls of using the exec commands. The program is initially paused on an ASL instruction. The exec command is used to inject a LDX #$XX instruction (opcode 0xA2). Note that each time the instruction is "injected", the current instruction is re-executed (as evidenced by the accumulator changing). This is an unfortunate side effect of the current implementation.

Please use this command with care, as it's very likely to go wrong.

go (g)

Updates the program counter to the specified address, ready to continue execution from that point.

Usage: g

The implementation currently injects a JMP into the instruction stream.

Example:

>> c
CPU free running...
Interrupted
07.372945 : E9F9 : 78       : SEI 
>> regs
6502 Registers:
  A=00 X=00 Y=0A SP=01EE PC=E9F9
  Status: ------Z-
>> go e364
07.372950 : E364 : A9 40    : LDA #$40
>> regs
6502 Registers:
  A=00 X=00 Y=0A SP=01EE PC=E364
  Status: -----IZ-
>> s 5
Stepping 5 instructions
07.372952 : E366 : 8D 00 0D : STA $0D00
07.372956 : E369 : 78       : SEI 
07.372958 : E36A : A9 53    : LDA #$53
07.372960 : E36C : 8D 8E FE : STA $FE8E
07.372965 : E36F : 20 90 E5 : JSR $E590

Note, in a system that is making use of regular interrupts, the go command may give unpredicatable results, an interrupt may be taking after the go command

Example:

>> c
CPU free running...
Interrupted
09.278068 : E9F8 : 08       : PHP 
>> regs
6502 Registers:
  A=00 X=00 Y=0A SP=01EF PC=E9F8
  Status: ------Z-
>> go e364
09.278078 : E59E : 85 FC    : STA $FC
>> 

This can be avoided by using the special command to temporarily mask interrupts.

mode (mo)

This is a BBC Micro command to initialize the System VIA, 6845 CTRC and 76489 sound chip. It's useful when debugging broken BBC Micros, to allow the screen RAM to be tested visually without

_Usage: mo [ <value> ]

The screen mode is controlled by <value> which default to 7 if ommitted.

6809 specific commands

There are no 6809 specific commands,

Z80 specific commands

The following additional commands relate to the Z80's seperate IO space commands.

There usage is identical to the equivalent memory space commands.

breaki (breaki)

Sets an IO "in" breakpoint on an address, or range of addresses.

Usage: breaki <address> [ <address mask> [ <trigger condition> ] ]

breako (breako)

Sets an IO "out" breakpoint on an address, or range of addresses.

Usage: breako <address> [ <address mask> [ <trigger condition> ] ]

in (in)

Reads a single host IO address.

Usage: in <address> [ <count> ]

The optional count parameter causes the operation to be repeated multiple times. If omitted, count defaults to 1.

io (i)

Dumps a block 256 bytes of host IO space in hex and ascii.

Usage: io [ <start address> ]

out (o)

Writes a single host IO address.

Usage: o <address> <value> [ <count> ]

The optional count parameter causes the operation to be repeated multiple times. If omitted, count defaults to 1.

watchi (watchi)

Sets an IO "in" watchpoint on an address, or range of addresses.

Usage: watchi <address> [ <address mask> [ <trigger condition> ] ]

watcho (watcho)

Sets an IO "out" watchpoint on an address, or range of addresses.

Usage: watcho <address> [ <address mask> [ <trigger condition> ] ]