签到天数: 1590 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
3 Z& q8 T: ]& S; |. pConditional Breakpoints
5 ?+ S' u+ R% C& C. |9 L6 ~. @0 j& C/ _
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:6 ~$ ~- X9 S; g0 A" j# u# p
2 c8 G/ v) {$ E# m+ f8 H% S/ A
Connect -> Compare { ('||' | '&&') Compare } : N c9 A E1 G$ P, E Y8 k
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
5 j l, t. H- a" ?/ V, I0 F' g# f' bSum -> Product { ('+' | '-') Product }
8 R- n; H! n6 e; c9 Y% sProduct -> Primitive { ('*' | '/') Primitive }
& {9 i4 s' S$ _7 pPrimitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')'
" D1 L. ]! c4 J1 jNumber -> '#' [0123456789ABCDEF]* 9 A/ A" U! U8 Q7 L
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
5 Z* B- P3 M- O, }% X1 m8 nRegister -> 'A' | 'X' | 'Y' | 'P'
* d. |1 I% @" X: c* R. gFlag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' 8 I" _6 Q4 g' I2 b" g3 F
PC Bank -> 'K' * k6 X9 q0 x" p# r @# A4 n; U# ^
Data Bank -> 'T' ' [+ @$ `8 E$ n0 N! n
6 e0 |# P$ }3 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.% {0 j$ r6 I6 d
( }. q8 Z9 F* H& Z' m eRegisters A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
2 _0 j4 a- s8 j. l: I% O
3 m6 ?7 O0 z6 G" J6 t; XFlags evaluate to 1 if set, 0 if clear.& ^# [" Z% p4 I, f1 ~% `- _9 T+ {
a, ?+ z! B0 u, M9 _+ MConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.
2 p& T v0 u) P7 C2 x& O& `. B8 r; s: a) x% l3 q' B
Example conditions:
# h$ C0 l" F0 f
: K) L3 M" m7 [1 BBreak only if register A is less than value at memory address $0005:/ b6 L4 ^$ z1 I6 r6 o Q
% [* m: h2 w0 v6 E9 I+ r: m9 fA < $0005
0 ~1 a% k8 z j6 Y: w4 E6 M% Z& L* u
Break only if the value at the indirect address is not equal to FF:" h' q# a& a" k! }( B! @
/ e! v1 W1 [3 G! ~/ k#FF != $[$10+($11*#100)] Z7 B6 h5 t5 J* V% b1 P' R
0 I0 l5 b# x# x3 B2 Q+ d2 w
Break only if flag N is clear or A is not equal to 00:
" H) d4 O) T/ u" ~7 _# g4 j7 ~& v5 h7 B2 `
(N==#0 || A!=#0)* T& r1 c0 [: [0 K. v- L% C' z
1 R' _0 `% ?! i; V1 L/ x$ TBreak only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):9 [1 y, a0 t F
7 q+ G4 a% } g5 `+ {# m$ @% IT==#2 & C( I/ T3 N' I0 t# f
8 v% c4 ~- X( X7 q以上内容来自fceux自带的帮助文档说明 |
|