签到天数: 2137 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点4 L; T# L' E5 t5 g
Conditional Breakpoints8 C' [# z! `4 _
: e% I5 ]( A: l' }1 W
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:8 b$ |$ d x# i7 I7 _8 Z
: a! Q" i4 R6 \. G( R) BConnect -> Compare { ('||' | '&&') Compare } 4 a* p0 ~, J9 R! |5 T
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
5 |8 [* h& c8 p4 mSum -> Product { ('+' | '-') Product }
/ T( C( B- [& X9 w" E5 `Product -> Primitive { ('*' | '/') Primitive } ! f( \) [- W, f) M( ~7 w
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' 8 T* f Y9 M- K" y( T
Number -> '#' [0123456789ABCDEF]* ' [$ {( X! D% f6 y4 i A% y
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' ; H; N9 o/ c% s2 h! \8 h6 y+ R
Register -> 'A' | 'X' | 'Y' | 'P' 5 R* W( B N3 T
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' , U8 r) ~. A3 u. v
PC Bank -> 'K' 6 t6 U8 {. S q- @$ K/ X
Data Bank -> 'T' % C" e$ U2 x _4 z* U" \" B
* s5 ]5 u" \0 N: X8 OThe 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.
; b( O6 c& i( I9 d, c9 a3 L6 T7 x- j
/ j) N1 }1 w3 G9 Y. SRegisters A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
* r3 N5 d; ~/ O+ I3 o% R) E: ^5 o) T' c' Z0 X! {8 P
Flags evaluate to 1 if set, 0 if clear.
8 N, i% o2 u4 O( W- [+ c2 _0 I- @$ W8 `, A, I7 z C. U/ P [
Connecting operators || or && combine boolean terms. Parentheses dictate order of operations.& s- T6 E* F; @. ~- _9 H
: I" D3 m. Q, Q. K
Example conditions:0 H! _7 ]' i( b
5 o: B# U0 H# h' kBreak only if register A is less than value at memory address $0005:
7 Y1 w& |. k$ k( s% ]; ]9 F
9 p, `0 H, e; q6 r3 Q4 ?: z/ nA < $00052 x/ j* y% X$ J O6 d
' R6 i) ^: p: H: }: b/ `Break only if the value at the indirect address is not equal to FF:
) }+ E% r" J9 K( g+ ^% R, B) P
- x# h8 z" N c#FF != $[$10+($11*#100)]
% Y6 X* L# U6 w* V& T0 y1 G# B/ \* ^; F
Break only if flag N is clear or A is not equal to 00:9 u. f- `6 e L7 |( r6 G* t
9 a- \+ g* i2 W m- }9 \4 R(N==#0 || A!=#0)8 a+ p* a% F2 L3 [$ h0 [8 K0 Z
: |! q# G% Y% Z; KBreak only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):" e3 z) j/ _/ W6 Z
& a* Y' F/ G1 o" A8 VT==#2
) |2 G, C* V7 e5 ^- k
# o2 S- p1 }, u/ L以上内容来自fceux自带的帮助文档说明 |
|