签到天数: 2197 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
' H- x% ~! [3 c8 LConditional Breakpoints
; i% l$ G% ^" Y" d( d9 f
' \1 Y3 I8 P% aBreakpoints may also have a conditional statement that causes them to execute only if that statement evaluates to true. The conditional breakpoint grammar has this form:' {" ]6 @& B# t Z' F+ Y( g
$ y1 m8 e: ]* H# @! ]
Connect -> Compare { ('||' | '&&') Compare }
6 b% G* U& a( P& ^ z0 NCompare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum } - @; \/ F/ X0 n2 j$ _
Sum -> Product { ('+' | '-') Product }
& ^4 k1 Y" y* R; z' P* t l' ^Product -> Primitive { ('*' | '/') Primitive } - k; `/ t2 @: {8 t' R! e; d: Q$ \
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')'
. X# _% }/ a" y: y8 oNumber -> '#' [0123456789ABCDEF]*
' s5 H% C! u% `) _Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' ! C/ N/ f+ \+ [7 A) I( V
Register -> 'A' | 'X' | 'Y' | 'P'
- m. `5 e( M5 @ OFlag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V'
F. Q: |: n* Q% yPC Bank -> 'K'
- `5 M8 T* H. v5 c( Q$ I/ P+ yData Bank -> 'T'
" B# V; ?4 e# \; f1 w' m9 }& D; _/ E' |* b$ m3 x) u/ i3 L# l
The parser is very strict. All numbers are hexadecimal. Always prefix a number with # for an immediate value, or $ for a memory address. If a memory address needs to be calculated use $[] with the calculation inside the brackets.( j# k+ L( K; `9 a- K
) k+ [/ i I7 ^Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
7 B( d( ]4 t8 o- f0 |( Z7 M6 G
; s" c# b% G+ M) W% q" UFlags evaluate to 1 if set, 0 if clear.* r q5 [- c5 X( ~; G
& ~/ b3 S; J+ l# {1 `8 T l
Connecting operators || or && combine boolean terms. Parentheses dictate order of operations.
( a' e0 {' P2 W$ b( |0 d/ E p, z; j7 Q& Y* H
Example conditions:; ?# _" e7 s* T8 C# ]1 q* N( b* o) R3 l
6 J* X: k3 }8 h& T' e Y* hBreak only if register A is less than value at memory address $0005:
: B+ B5 s- _ T/ g: y6 P2 u
) O+ k5 S% _! f$ }" K, F2 qA < $0005
( R; o' p, B) [1 e
2 ` D6 W4 O& J' t/ C- m( w& b9 iBreak only if the value at the indirect address is not equal to FF:
! p1 b9 q0 s' F- `1 ?
7 {- O6 M7 S( Q& E% I& x* l#FF != $[$10+($11*#100)]
; v" l& Y: @. l5 t1 a
6 O _/ G& H" KBreak only if flag N is clear or A is not equal to 00:- K& H, F- @& w
% K( I4 {9 O0 T; ~% ?) I8 N(N==#0 || A!=#0)% H6 _; m8 d) V8 ~' L! K9 Q2 f' b
) T; j: t& R }) y
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):
' ]# p9 {. ~# {7 e
1 i4 W% G) ^6 e/ A2 r; u9 n- _T==#2
8 \0 ]1 O! c' J' ]6 I4 Y
9 r3 r" b. O; }& P7 Y5 Z" r以上内容来自fceux自带的帮助文档说明 |
|