签到天数: 2050 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
% g. p7 k+ u* iConditional Breakpoints# i" \; r4 x& f' H& ]
$ x+ Z7 k, s; l/ T+ ~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:
* Y/ Z. U% d$ N7 s& E& e: E
- H. O* @7 T1 y$ q& W3 ]' XConnect -> Compare { ('||' | '&&') Compare } 3 L- W1 f; [/ o- S
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum } # c# d3 u2 @1 ^, v: t: i
Sum -> Product { ('+' | '-') Product }
( x# s) V; O* g: Z- ~1 S7 q2 kProduct -> Primitive { ('*' | '/') Primitive } ) ]( h" U+ O+ F/ }
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')'
1 Y) D s3 p: G' dNumber -> '#' [0123456789ABCDEF]* ; I4 y8 ~, }8 }5 r: q
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
4 b3 |. d" B- S* i- TRegister -> 'A' | 'X' | 'Y' | 'P'
* L2 d/ g3 n4 N* U) ~( q2 RFlag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' ' k& c0 I4 L/ o& q$ j+ y
PC Bank -> 'K'
7 \$ k" D! W4 K0 V. L6 b1 e5 zData Bank -> 'T' & ?2 l& U* v+ y' @! \0 H
! I M/ Q1 T1 O0 `: z4 zThe 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.' I/ J0 N! }; P
8 ^6 v, K2 s9 O& n1 c$ ~Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.. Q- I5 B& |' P$ \7 E1 A/ V
) ~% \% U- M- g& M' FFlags evaluate to 1 if set, 0 if clear.
; c/ S8 |: s0 i/ ?- S/ h! Z# \0 J4 O) r1 O# v/ Q
Connecting operators || or && combine boolean terms. Parentheses dictate order of operations./ S1 J; g5 ] c
$ T! \# O3 ^. _Example conditions:
3 L7 F! f% Q- V$ p$ L8 Y: ]
( P! J% g6 I2 a: L8 a6 ~Break only if register A is less than value at memory address $0005:
" l! C: V# o% _
/ d: p# s! ]* P- Y" V) `2 OA < $0005
+ s$ y n6 j0 i& k* }$ _- H" ]6 a! P
% C+ f7 ?. R8 `! \2 C6 w% Y1 g( @Break only if the value at the indirect address is not equal to FF:
% g9 d% B4 D' h& E
; X: E% P6 J0 m; z( r) i9 B#FF != $[$10+($11*#100)] t' N6 y9 i. w( p p% ^
1 n2 z' R! w- O/ l* E! XBreak only if flag N is clear or A is not equal to 00:
% q* G0 j9 o- _6 E! t6 g2 d5 u: g3 I# a+ g6 |
(N==#0 || A!=#0)) T% m6 l7 B1 ^/ z" I9 i1 K
& y% W2 j) u L( Q) eBreak only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):! e# ]. X8 l& l+ p% g" d
3 H E( u! X- ^# |0 w4 eT==#2 9 y: l$ F! q+ k9 {2 F
e# @6 b# Q) R& l3 O3 X ~5 F以上内容来自fceux自带的帮助文档说明 |
|