签到天数: 2105 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
5 Y* ?1 R3 L4 y6 v/ H8 a; t4 oConditional Breakpoints
$ ?* g3 I" \3 p
& |1 y2 w) C j- Y' x% I. |Breakpoints 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:
- `# t: H5 b8 Y! [7 ^2 f) {
5 j) G& ^% R4 W9 T- P, ?0 Y7 G, W6 a2 EConnect -> Compare { ('||' | '&&') Compare } ! Q# m5 A4 R8 X0 t# b' k
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
$ E( r0 y0 M( E+ @Sum -> Product { ('+' | '-') Product }
& t5 ~. |1 g! w" WProduct -> Primitive { ('*' | '/') Primitive } * p9 S/ M) W$ J# a( _
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' 7 V2 U4 p0 [( B# z- T- ~. k h
Number -> '#' [0123456789ABCDEF]* 2 k8 n) u) a& L- Q# l! z" R% E! w
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' - }2 `" m" C: f7 J# M7 k
Register -> 'A' | 'X' | 'Y' | 'P' 1 _. U3 J4 f4 R& I8 e
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' ' J8 d5 x# T8 l2 C5 A+ Q
PC Bank -> 'K' 6 w) Z) h. {' ^9 O g, }$ c
Data Bank -> 'T' " U; ?7 _! g. i1 T8 G6 H
/ Z0 u U7 \! g
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.
/ x4 ]/ D5 f0 j
2 h2 ?. Z: t1 h! E. H9 GRegisters A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
$ w' m! a- t; {5 L9 A( _ w) k) l9 Z! r! Z5 r& j7 m- P: {8 q
Flags evaluate to 1 if set, 0 if clear.3 ]2 q! N x& ~6 N2 O; P7 Y
0 r- O8 h n/ N, |
Connecting operators || or && combine boolean terms. Parentheses dictate order of operations.
' ]: G: J/ l9 M' O' ?6 U; X) n4 k2 |3 r
Example conditions:: [9 m+ l8 k& W$ E' h
7 ]* ]& J. X, t! v( |7 I
Break only if register A is less than value at memory address $0005:
! v7 X1 K) a7 {# ^& K4 @* J9 U
8 i0 _8 b$ v" X1 _A < $0005
( _3 d1 ]4 s3 b" B/ X& Q
( N) `* J, r# N$ i% o- ABreak only if the value at the indirect address is not equal to FF:' ~" d% a9 _% ]8 q
8 H% s: v( p/ _# r: J v#FF != $[$10+($11*#100)]; A6 y6 @5 x- r: I
6 s6 Q" n" z m1 Z( Y3 D( C7 M/ ]Break only if flag N is clear or A is not equal to 00:# F# k) ]* i: J2 j) |4 U
2 }3 j% O, r8 N
(N==#0 || A!=#0)
% U, C, H$ X* E. h, L6 b2 q7 n+ f/ q8 v0 U* i4 m* N
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):- C$ B8 k7 M* E6 f
* e S# }7 o T% }' z$ j _
T==#2 4 f" w* P; v7 l% L, a! l4 e
4 }) h E O C8 F0 E以上内容来自fceux自带的帮助文档说明 |
|