签到天数: 2072 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
( M/ I- z( b4 B4 [Conditional Breakpoints& X0 V; L7 O, J& F. n
. x q3 C4 l0 J) CBreakpoints 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:1 _' O3 |4 U& e1 ?
1 y; [ p" V# _
Connect -> Compare { ('||' | '&&') Compare } 1 c4 t4 c4 d) Y+ H W: S
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
/ s6 g* \# a& j; R8 E5 Q1 \+ ~) hSum -> Product { ('+' | '-') Product } " C$ }& s( o- T; h! D, Z
Product -> Primitive { ('*' | '/') Primitive } $ y! |* B/ t+ M" B! Z, a
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' . @8 \6 N- |9 c; {
Number -> '#' [0123456789ABCDEF]*
- n8 G- V1 F U B2 tAddress -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
+ T3 G; a. j$ XRegister -> 'A' | 'X' | 'Y' | 'P'
9 X8 T! d. [/ R6 BFlag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V'
7 U7 M x7 m% k8 l& aPC Bank -> 'K' % y9 g% r5 q0 O+ i
Data Bank -> 'T'
; f7 Y1 A- C7 h: [
; F- n- i$ j) C6 o" L4 j* rThe 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.
3 ]2 @8 n3 f! C( N+ v! Y" g! M7 ~% B) C& R; X
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.5 v$ C/ w. K2 Y9 Y% f' X
8 ^) {' q5 ?! UFlags evaluate to 1 if set, 0 if clear." `8 [* P2 y! e+ j3 i4 d: B
- S* ~& t2 v' }$ k' LConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.3 \0 B% i; Z% b2 o8 r
S- C1 J p7 g8 Q' E; ~/ @6 U% I
Example conditions:
2 I' G2 A O/ ?; ]
, m3 m# i) t! ]9 l4 N3 QBreak only if register A is less than value at memory address $0005:
+ A! l2 m; t" M) U6 m( i% Z
8 P0 l! |3 S( z6 b% a; [A < $0005
) K# |1 {: T. b9 O4 o8 `5 Y7 j. z' z3 j( W8 D: n5 K
Break only if the value at the indirect address is not equal to FF:6 G) K0 }8 X) P; G
# o$ ~4 w% o# Z% a2 R5 O: B' W
#FF != $[$10+($11*#100)]
: g3 p4 y* A% u( o
7 A7 E u+ ~; f& Z% u' X$ KBreak only if flag N is clear or A is not equal to 00:: s9 g4 Z& ?; Y- Q" Q+ w2 T
\" o8 D1 n8 U7 q4 o0 \2 n
(N==#0 || A!=#0); S4 z9 E) _# B9 ~
( K- w' i: A; m. Y" _, M2 tBreak only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):
# B' Q* k- E2 C2 E
3 H8 K2 E' ~3 z% s# LT==#2
) [! G/ p- ]2 c" v6 ^: X9 h# G, ]
8 n1 V& G3 b6 f. v3 f以上内容来自fceux自带的帮助文档说明 |
|