Breakpoints

You now have a variety of options when specifying a breakpoint.  Breakpoints can also be disabled, and later re-enabled.   This lets ones set a bunch of breakpoints, and quickly re-activate them without having to re-enter the breakpoint logic.



Command

Effect

BPA r [op] value

Adds (conditional) Breakpoint.
Default operator is equal ‘=’
(In a future version, will dispatch to BPX, BPR, BPP, or BPIO.)

BPX
BPX expression
BPX address[,len]
BPX [op] symbol

Add Breakpoint trigger to stop executing when the PC is within the range of the Address, Symbol, or Expression. i.e. Range is: [addr,addr+len)
Default length is 1.
Default comparison operator is equal ‘=’

BP

Currently an Alias for BPX.
(In a future version, will also support Loading and Saving of breakpoints.)

BPM address[,len]

Add Breakpoint trigger when memory is accessed by 6502.

BPMR address[,len]

Add Breakpoint trigger when memory is read by 6502.

BPMW address[,len]

Add Breakpoint trigger when memory is written by 6502.

BPR reg [op] value

Add Breakpoint trigger when Register’s ‘reg’ value is compared to the Value.

BPV vpos[,len]

Add Breakpoint trigger when video-scanner's vertical position matches vpos. (NB. Auto-disable when hit.)

BPD

Disable Breakpoint (grayed out).

BPE

Enable Breakpoint (colored red).

BPC #

Clear specified Breakpoint.
Note: The asterisk ‘*’ may be used to clear all breakpoints.

BPL

List Breakpoints.

BPIO

(In a future version, will add Breakpoint trigger on memory read or write.)

BPP

(In a future version, will add Breakpoint trigger on specific flag cleared or set.)

BRK [0|1|2|3|all] [on|off]

Break on BRK or Invalid 1-3 byte opcodes

BRKOP [opcode]

Break on Opcode

BRKINT [on|off]

Break on Interrupt



The general format for the conditional breakpoint is:

You can use the following comparison operators:

Op

Name

Effect

=

Equal

Break when register is equal to value.

!

Not Equal

Break when register is not equal to value.

<

Less Than

Break when register is less than value.

>

Greater Than

Break when register is greater than value.



Breaking on any of the 6502 registers is fully supported:

Reg

Name

Effect

A

Accumulator

Break when Accumulator is triggered.

X

Register X

Break when Index X is triggered.

Y

Register Y

Break when Index Y is triggered.

PC

Program Counter

Break when PC is triggered.

S

Stack Pointer

Break when Stack Pointer is triggered.

P

Processor Status (flags)

Break when flags are triggered.


Notes:


Examples:

Input

Effect

BPX < F000

Add Breakpoint when PC < $FA62.

BPX PC < D000

Add Breakpoint when PC < $ D000.

BPR A 0

Add Breakpoint when Accumulator is zero.

BPR A ! 0

Add Breakpoint when Accumulator is not zero.

BPR S < 1FF

Add Breakpoint when Stack has had something pushed onto it.

BPV A0

Add Breakpoint when video-scanner is at line 160 ($A0) which is the start of the MIXED area.

BRK ON

Break execution when the opcode to be executed is $00 (ie. BRK).

BRK ALL ON

Break execution when the opcode to be executed is $00 (ie. BRK) or any Invalid opcode.

BRK 0 OFF

Disable breaking execution when the opcode to be executed is $00 (ie. BRK).

BRKOP 6C

Break execution when the opcode to be executed is $6C (ie. JMP (ABS)).

BRKINT ON

Break execution just after an interrupt occurs.