签到天数: 2074 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
/ j$ R2 e4 |% S: y5 T/ RConditional Breakpoints6 N D, p5 e2 {# d
( S6 W. O( O1 h: e9 O& h+ b
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:& J& H- c' Z4 a1 F! ]
( q8 i4 {8 h2 K% V! N8 SConnect -> Compare { ('||' | '&&') Compare }
2 s, q ^$ ]5 _) B! YCompare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
, Z C, K3 R0 p( Y0 o- YSum -> Product { ('+' | '-') Product } : g6 V" i. S: S& m. s+ I# K
Product -> Primitive { ('*' | '/') Primitive }
; u7 p) N: Y e! {0 m6 tPrimitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' 3 ~! x. C; f* U3 ]+ `0 T
Number -> '#' [0123456789ABCDEF]*
o# ~, o* L2 _- d5 V" q; S7 Y. lAddress -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' W$ F5 U, b W$ h
Register -> 'A' | 'X' | 'Y' | 'P'
& s& o+ Q5 w- I) bFlag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' . \! {3 \0 m$ M' @7 T. o! {- j6 ]
PC Bank -> 'K'
: `* c( X5 W X, _" E1 |Data Bank -> 'T' 8 ]2 O4 Q) Y5 ~
9 t; k- w j1 o
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.' `2 O* W1 _& [0 j( C2 Z, r
. n* H, }8 `" q6 E
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.! R! ?& X7 O6 ?, t
$ e G2 [8 d4 Z1 A. |- hFlags evaluate to 1 if set, 0 if clear.: W$ y1 n+ s- s; l* m1 X( O. a
( y) F) p8 o2 T2 i& vConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.
* |$ L% l) g. l3 k* |, y0 a
6 r5 N9 q6 o' ^% |Example conditions:9 O% j- T' l# i
# i5 A, x @. L7 n; lBreak only if register A is less than value at memory address $0005:
2 n2 }6 }# H$ a) V/ Z. t4 u% b* x1 F: o: X& \5 ~
A < $00050 d+ H" T8 F; u. N
2 e! J8 {8 K. E# n$ o
Break only if the value at the indirect address is not equal to FF: Z; ^ s; G) l" q# f
$ ?0 K% y g* w: K' F. b' l1 _
#FF != $[$10+($11*#100)]# a6 ?" O# n) l
9 V1 e' J. L8 N
Break only if flag N is clear or A is not equal to 00:
9 T6 C) w2 L8 S$ O) w `+ i: V, M* H& H# \- v; T1 k# V
(N==#0 || A!=#0)
# P" ]& H0 _% X/ u0 F- L5 G- J+ C# i
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):
! e) q" L5 m S) \9 n# F6 z2 Z' A! K# S' P; Z7 K+ }5 x$ T! i
T==#2 5 q4 ]) k# ~# k- ^) D
1 ~/ e/ Z& }; e) O以上内容来自fceux自带的帮助文档说明 |
|