签到天数: 1981 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
5 t0 P7 D( {8 T- h- U1 yConditional Breakpoints
5 H# [6 P( S) s5 M, x( b
4 L/ e- a- Z: T6 W4 ~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:
1 R# O/ |, |, F3 q' I5 H `3 M
5 Q% w' S5 q3 Y+ ^Connect -> Compare { ('||' | '&&') Compare } 5 x% S$ h3 B* O8 v
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum } 1 {& u6 S5 @" m6 ?+ w" M
Sum -> Product { ('+' | '-') Product } 9 C# N; ]2 P2 O
Product -> Primitive { ('*' | '/') Primitive }
$ \- S+ F$ R8 C( Q" S, aPrimitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')'
; [2 Q! U- X! H& eNumber -> '#' [0123456789ABCDEF]* 5 t6 |; d5 m9 |5 b1 ?
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
8 ~: M( Y+ ~$ E2 hRegister -> 'A' | 'X' | 'Y' | 'P' 9 H) J( a" o o/ h9 b- W
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V'
+ @$ q: |; D2 P$ ZPC Bank -> 'K'
$ a; c+ {9 a# |/ JData Bank -> 'T'
6 [" ~7 Q- v- @" e1 S$ I4 I) \% o( r$ U% C
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.
8 P: ], v3 v! [3 ~' U
6 Z+ I8 W$ B( o* M1 RRegisters A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter./ W+ R5 F: i6 W) X3 p9 S8 O! j2 e
: I, G: Q: ]' q! E' ?, MFlags evaluate to 1 if set, 0 if clear.! W9 W' M& S; z6 _: B2 }& Y5 l
) z/ i) }" ^; X+ cConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.! U" x6 y# \5 L; k, M X
( r. p) c; n. j& j4 d3 K5 w" l
Example conditions:
* A- ~! B8 \) Q, p. T& b( _& I" |' ^' H% Z" ^: g5 i( I5 M# X5 O
Break only if register A is less than value at memory address $0005:, N7 `+ x; g: u# J0 j1 G2 f
& X8 i/ q3 V' v8 H) Z- J6 jA < $0005
' J, \: K0 F# d' n" z8 ~+ {' o# k% U5 K
Break only if the value at the indirect address is not equal to FF:
! S3 G d2 U T B: H9 W7 O- H/ v2 Y: h H- N: H8 c
#FF != $[$10+($11*#100)]
% @6 j k2 p/ Y3 N
2 [8 L$ h! [8 m( VBreak only if flag N is clear or A is not equal to 00:
; S4 n( A9 u3 Q1 l3 b/ t, i8 u9 N
& G$ r6 T# o B& H(N==#0 || A!=#0)2 q2 H$ O: C( n. D% }
- p, T( N+ x* q G0 _2 fBreak only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):
8 {$ J2 P/ Z- V! e1 I& h% s6 [4 y, Q
T==#2
: [0 r& a( j$ I0 ]& m+ _3 Y' Z. [ }7 u5 u. o, V5 q9 d" R
以上内容来自fceux自带的帮助文档说明 |
|