签到天数: 2124 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点: e$ h" Y- @! Q m* \2 L
Conditional Breakpoints
& w O* o# X: l3 B. a+ w7 W
( ~; |3 R. `0 OBreakpoints 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: e/ z5 v6 o0 k" Y* ~ B! w
, o+ c8 v7 e* F6 H. wConnect -> Compare { ('||' | '&&') Compare } ) O9 i: C& m5 S- n( i3 G2 {
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
/ w7 x$ @4 n9 n4 ?Sum -> Product { ('+' | '-') Product }
- h( L7 R2 \3 w) |/ OProduct -> Primitive { ('*' | '/') Primitive } $ d9 [) \. X* u+ ^1 Q6 L
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' 3 [; E1 B I- J% o5 L5 L" T
Number -> '#' [0123456789ABCDEF]* ! I: E+ \$ w) D# u0 Q7 R ` M# j
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
. j4 Q- Z0 z0 C5 J& Q3 [8 gRegister -> 'A' | 'X' | 'Y' | 'P' ( k+ u% e5 @5 T S: ]) N* t/ d: J
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' x- w1 c$ e0 `- d& x
PC Bank -> 'K' * ?7 `- R+ B, S1 S& u, g, f
Data Bank -> 'T'
9 R9 y! S5 e) c- ]3 n% S3 i0 e' ]" r4 m z3 [8 |: N' @
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.
' H% Y! |( T3 `
' D/ }0 |) `. N7 ^ m- VRegisters A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
! }+ {4 S1 W* V! w9 O, {& S8 B
$ l3 Y3 G' Q: z" k: E& VFlags evaluate to 1 if set, 0 if clear.' W# b& `( t" A" D# ]0 T
) K0 n9 o, X J9 hConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.
0 W. }" P% r X) q, h4 V$ `2 Y7 Z' J9 G- y. M
Example conditions:
$ z' f9 V; f: _; F
* \6 {9 q' b! T5 K. ]' ]# L. yBreak only if register A is less than value at memory address $0005:4 @+ O) V+ y8 S8 L5 L
/ Y# n& ]( ~+ ]/ l3 K1 |; lA < $0005
( [; F1 E( V) ` H$ H: c
, N9 |" X) b' D+ ZBreak only if the value at the indirect address is not equal to FF:; M+ Z6 t6 ?8 A9 y8 q0 l7 ?
6 h3 l; [3 i* V) k( [" j. g( j% }
#FF != $[$10+($11*#100)]
- h8 E7 p0 E+ A! Q5 b: z2 a
1 N y0 S6 S) ?) ]7 J" bBreak only if flag N is clear or A is not equal to 00:# A! O- v# w E1 g. D& T( M
$ u9 \( z1 q& J! m, @( D# r
(N==#0 || A!=#0)1 E2 @2 Q) u( Y; O/ Q: H- c; _
; h# ^. D" a2 i4 G
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):9 j }7 `9 d2 F) _1 m: ~5 q* f0 h
0 @% i) `3 S5 O3 P" B! F& _T==#2 ; b+ R& }* `( b) T
' k- |. y6 O$ q! i
以上内容来自fceux自带的帮助文档说明 |
|