签到天数: 2218 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点" w( x- q% E- D. U, N) _0 y
Conditional Breakpoints" R" x* H% D$ r0 @5 h G: b
% b( ?2 C3 m, _8 S$ \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:/ N b2 G6 _ T& a6 |
6 R1 r- [/ F& _0 HConnect -> Compare { ('||' | '&&') Compare }
; E+ D, E4 S0 ]) p! m- oCompare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
: I' b) Z7 s- q/ o L& vSum -> Product { ('+' | '-') Product } # q2 W; ~* F4 q& H- z
Product -> Primitive { ('*' | '/') Primitive } 7 H4 n8 e" W l5 S
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')'
6 V$ r& E6 ?8 v& m% e% vNumber -> '#' [0123456789ABCDEF]*
- |2 y1 j8 J, Z2 R1 KAddress -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
9 `7 N# L' L. KRegister -> 'A' | 'X' | 'Y' | 'P' / W. [6 R' u2 q" B" C( j: |
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' r0 O, R3 W, G2 w3 s
PC Bank -> 'K' # n! G) H" W* Y* j5 v9 k7 T u
Data Bank -> 'T'
. d2 \0 D( {0 c! g- g! [9 s* d
% _+ _( h% j7 ?0 HThe 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 V7 v$ W. J1 r u* g1 V' W9 I+ V5 M7 d& p8 D3 k3 V& p
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
) w' e$ i) `, m
3 k" r: z% S0 ~/ i& B" nFlags evaluate to 1 if set, 0 if clear.2 o4 e2 w1 {3 p8 ^" t. N: @
, u |! u8 ?8 |2 `Connecting operators || or && combine boolean terms. Parentheses dictate order of operations.. G( N# i( @+ n( i* T
9 Y. e1 t% G+ m4 }% W5 v5 U2 ^0 V
Example conditions:
% _5 M. F9 N0 B; X J; j( P
! c/ t$ { S# i$ H. mBreak only if register A is less than value at memory address $0005:
# M! o3 v5 w: r7 I) P" E7 M* @
4 _1 J4 H( ~, d# y' ZA < $0005
7 C) G% e/ {/ S# o2 A% ?- [8 G
Break only if the value at the indirect address is not equal to FF:2 J$ R/ b) ?- }, Y3 }7 Z# v( D
8 l3 {" g; h) I+ |
#FF != $[$10+($11*#100)]* c% u3 m! q2 N9 q' Q$ C+ `8 I
5 Y, J1 _3 I" v) M3 \6 @
Break only if flag N is clear or A is not equal to 00:
5 g ^6 A$ b) H2 h
6 l0 x3 Q3 u0 d9 |/ N8 p(N==#0 || A!=#0): N/ ]( p/ o. m- R
3 t% N. b0 ^9 S$ m
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):
' c0 w7 T* y' P/ n. @8 ?5 p
5 p9 b1 j4 u Y! _. I/ T- O$ MT==#2 a2 Z& Z) S, m1 d& q6 l
! Z# L H0 G0 _以上内容来自fceux自带的帮助文档说明 |
|