签到天数: 2074 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
' k/ c. [: J' wConditional Breakpoints
: ^. ~! z1 m9 ?9 l$ J% W; f0 Y5 s- G0 X
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:
* r+ O5 H4 r. f& D, }2 h2 z. T6 r1 t7 ?& I }) X; m3 R
Connect -> Compare { ('||' | '&&') Compare } 7 L2 i- D# k2 N" ?& ~
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum } 0 u( m0 G: w* }1 o( x: E0 f
Sum -> Product { ('+' | '-') Product } , N: Y! Y" S% Z& j) C
Product -> Primitive { ('*' | '/') Primitive } " l7 ]2 M; \( { p. ?
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')'
$ H" m. o5 ]6 {7 }! ?: cNumber -> '#' [0123456789ABCDEF]* 4 G1 ^/ p' B4 \) ^; \; T A3 |3 D
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' 0 z. k9 I& v I6 ] Z: ^ _! d2 d
Register -> 'A' | 'X' | 'Y' | 'P' $ B! f# x% A$ v R5 P: H
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' - P& y0 S; t' s3 h( n8 S
PC Bank -> 'K'
$ S$ C' G/ T( `0 r0 OData Bank -> 'T'
9 N% I [+ o- \
+ G" T7 l5 V& J$ lThe 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.
" v+ s2 F) k# l+ j9 f: G* z
1 `0 B- B2 R: D1 p4 G1 ZRegisters A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
1 b) e: F, O8 e- Q
( |& x' a7 {9 A" |0 |) xFlags evaluate to 1 if set, 0 if clear.
. [& R7 d; y+ q( s+ U9 X
( M, {. p' L% [9 B) M9 @Connecting operators || or && combine boolean terms. Parentheses dictate order of operations.
7 J& a1 `( Y5 K. p6 e9 h* k/ x6 f% k1 k
Example conditions:, K: l8 J* w- {1 [0 p- n
: C% W3 `$ m [! BBreak only if register A is less than value at memory address $0005:/ b' U1 m( p0 k
# u( ~& z- j- u( @# o# FA < $00053 D$ h8 B' `3 J' L; `* }/ E% Z
) w7 }% I* V9 gBreak only if the value at the indirect address is not equal to FF:. W4 O( B$ D' q, E% T
* ^0 d5 _# o( m, I/ Y( S#FF != $[$10+($11*#100)]
5 ^0 l5 D& T! H3 u& M7 `
1 p- P& H/ [! i* H c# w; M- @Break only if flag N is clear or A is not equal to 00:4 `* x2 j6 @7 i7 b/ Z! Z9 ^
6 T# M3 |+ w) t! \* A: C, q% m
(N==#0 || A!=#0)
" t8 _8 ]& f3 _, ?$ r) ~" \! J- Y$ ^) r; Z2 [
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):* b# j Z2 U! q
, e7 M4 F; s4 r* S7 o& y- |
T==#2
% v! Y( c+ G1 _" b- c
. a( t8 f+ ^! ^6 L3 H以上内容来自fceux自带的帮助文档说明 |
|