签到天数: 2074 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
& u; ~. p$ @9 z7 c) K7 S$ o& ^Conditional Breakpoints# i' [- z3 u1 m" h
" t6 R- P- o: o8 k H& {0 GBreakpoints 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:4 r" W8 a0 c$ b! x3 m1 Q& w' Q
3 h6 `3 S# M8 k2 F5 q: b% NConnect -> Compare { ('||' | '&&') Compare }
( |. A2 G: t& D: O3 Q# f8 j! oCompare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
5 d9 u0 I; P: uSum -> Product { ('+' | '-') Product }
* B6 o& x9 `' }3 q/ @Product -> Primitive { ('*' | '/') Primitive }
8 n7 W. ~/ u$ d X% NPrimitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' * T; d) A$ V$ s w. A$ @6 {" i
Number -> '#' [0123456789ABCDEF]*
* |/ W E& i: H$ F4 z, cAddress -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' + d' P0 B1 L. }
Register -> 'A' | 'X' | 'Y' | 'P' 1 S: a( n# V/ W5 A9 V
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' 0 S. F! W* R0 J4 z9 a1 I" w g5 u
PC Bank -> 'K' ) E' P c. D2 C) L
Data Bank -> 'T'
7 `5 u9 n7 F8 @% C) u# L _) j( h4 h6 e& X
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.
- K8 l# }$ \* W6 i1 d9 r& [7 `; T2 P
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
2 ?# h2 @3 u2 B( b) S8 a n$ Q- k6 F# O; P1 \" R! t" p
Flags evaluate to 1 if set, 0 if clear.6 [( ~6 b& F- N3 a; S. j
* R4 x( `6 K9 d& q- L. k0 p, [Connecting operators || or && combine boolean terms. Parentheses dictate order of operations.
0 U2 M! r7 j$ R: M) S8 Z2 h5 m& c2 i
; P" a5 m5 }; Z. o1 ^$ OExample conditions:" h' r0 u) ]' N7 O+ a7 {4 J
% @- }, W1 f! V% U$ K( e6 y6 w; j
Break only if register A is less than value at memory address $0005:1 Z* }! c J0 b8 R/ D* D
1 X8 P; L1 g- P* c$ LA < $0005
9 l/ s c7 d; B2 P `
9 g- X" x5 W- k, r4 g1 P. g( o6 eBreak only if the value at the indirect address is not equal to FF:/ M) Y, \4 [- z) m8 b) T
+ N, H! G# ]/ }- X6 A* ^#FF != $[$10+($11*#100)]) ]; P# @: _! ~0 i7 C1 F* j Q
- M9 j# y, G- ]Break only if flag N is clear or A is not equal to 00:* h: J, x! ~0 U) X7 `
2 w9 @* I5 t+ R# ^* t5 _(N==#0 || A!=#0); u; Q+ G! z. |# m/ K* K
6 K, J& n& b7 t# o: R' i
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):
. I+ Y. `8 f! b2 O( e% P
* f" ^/ f6 `+ d/ m8 iT==#2 2 e1 m7 V% j: I8 z. `* a7 a- `8 z$ R
$ R# p( G+ d8 H4 p$ Z5 a
以上内容来自fceux自带的帮助文档说明 |
|