签到天数: 2053 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
1 I; ^$ \+ j0 @! R4 sConditional Breakpoints
0 @+ U6 ^ M6 P! k# z$ B' c% w' a8 P6 s3 n- R
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:
4 S; F. s) Q1 v& `1 n3 L+ }/ S4 ]% t* E) q R! g6 N
Connect -> Compare { ('||' | '&&') Compare } 0 O9 z9 f: E0 v5 p6 |% b' B
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
0 K) C8 d, C( Z1 V! xSum -> Product { ('+' | '-') Product } : z/ m0 D2 V, W
Product -> Primitive { ('*' | '/') Primitive }
. t. a$ j: J, F/ G: h6 b9 }Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')'
4 {: e. P$ s6 x: U' i& b6 J0 ^Number -> '#' [0123456789ABCDEF]*
2 ~" d& l6 Q5 ^, j% vAddress -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' N7 [6 V& e& ^3 ^1 r
Register -> 'A' | 'X' | 'Y' | 'P'
5 K% @0 w: I5 yFlag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' . \8 R7 d' ~' }" v/ i/ L' j4 |0 q
PC Bank -> 'K'
5 y; P8 q; ]" A5 P9 G EData Bank -> 'T'
( w j3 x U ?& p) @
1 @3 c+ E7 Q6 _% G! K6 MThe 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.7 [% d* X6 B( P& q. b" o+ f
, ]8 h. u/ W3 h P# m
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
: B: y6 z, g+ ^) [# w. H/ k1 _& q% }9 d2 E& q
Flags evaluate to 1 if set, 0 if clear.8 }9 C3 b+ p# I- _
& l+ F' m2 O" @. V8 @
Connecting operators || or && combine boolean terms. Parentheses dictate order of operations.8 v/ g7 a, @5 x5 W! |. i
( I e. `1 \, A6 b% p+ U1 A! x) c
Example conditions:
2 v2 ^, G2 D7 T5 c$ h) _5 x) t& Q s4 s, J
Break only if register A is less than value at memory address $0005:1 G+ e, @ |# q/ e0 @& w
( \- p, [' I1 v* aA < $00053 _% \/ t+ N0 l' S }; c/ ^ @
5 |, U5 z; T! S" U7 R
Break only if the value at the indirect address is not equal to FF:
/ n0 U' ^4 P7 p' X* z3 S8 }9 h# l
#FF != $[$10+($11*#100)]" m( I1 D: J' r: w
& e7 M' a @! p( Z' UBreak only if flag N is clear or A is not equal to 00:
- M. E! ?! V7 n, Q) m
4 _: q% X( F$ [! N2 ^ I(N==#0 || A!=#0); J7 p9 M4 g. z/ `2 `
, v( u# @" o9 S3 w8 B: EBreak only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):
2 Y% D1 p8 H" L) s. _. d4 I# g" O
, ?" m6 r" Q9 \+ t5 o- N8 iT==#2 9 c' M: d% a2 V/ C% \5 w
2 Q* U1 X1 x9 l% ]
以上内容来自fceux自带的帮助文档说明 |
|