签到天数: 1891 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
" o" u) F( T# c, a/ aConditional Breakpoints
7 x- t, [1 a7 d+ _' G$ a, O2 d a- K: R7 y7 y) I! D
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:/ h7 b$ Q' w4 V- B
7 U6 a4 h& M1 F/ u" p3 F+ G$ CConnect -> Compare { ('||' | '&&') Compare } 5 C* p9 Y( a7 W: I9 D9 R9 u
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum } - c6 W) W6 A1 w) V/ G' [( C) R
Sum -> Product { ('+' | '-') Product }
# }4 D5 h1 g$ g- KProduct -> Primitive { ('*' | '/') Primitive }
: |3 a4 k M* ~' GPrimitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')'
5 ^( i+ y' C4 e+ F" t4 lNumber -> '#' [0123456789ABCDEF]* , b, @' e) x T$ P9 L7 L
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' & {) f: U" t: q6 z) k. H- |
Register -> 'A' | 'X' | 'Y' | 'P'
- A3 u p& u$ g6 |" `& n S% lFlag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' 2 _1 f! r( J7 E! F% e, Q
PC Bank -> 'K' ) e8 ]) l% w) E3 r
Data Bank -> 'T' 1 y+ Y. | @# V3 B5 N9 D M# @
/ v- m; e6 a, m6 T! i5 z, AThe 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.
# l+ J' h, u# n2 h# T6 ?6 g4 B2 d3 a1 K
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.8 E# S' D: U* C8 f8 a. Q
2 N8 ?! G+ E: P* j) Y$ E
Flags evaluate to 1 if set, 0 if clear.+ A$ q8 @6 k, [- C
) u( A0 e2 U# VConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.
& Q% G3 w; \1 z u/ v# o: F, \! N4 u, M1 A) _
Example conditions:( y8 N: h. J% s- Q5 m+ J8 m4 s
; v8 z* @0 J: i. Q% Q( i
Break only if register A is less than value at memory address $0005:- g% h9 v5 ^2 c" S
7 ~6 x7 G/ R& S5 WA < $0005
; @0 V/ u0 w6 E C S! {/ ?, f/ F+ i) R1 O6 V
Break only if the value at the indirect address is not equal to FF:
8 r3 L+ T# r9 X" D8 A' W: ^' h+ N' b
" H; Y( ~ \: z- [4 \/ w8 I1 M" y#FF != $[$10+($11*#100)]& D( w% l8 I# q8 K4 F4 f
7 l& h4 j7 {( q; c: b5 `- q! gBreak only if flag N is clear or A is not equal to 00:- P) R2 U: B( \$ g2 w3 ^
1 ]: ~: v( S2 B1 G(N==#0 || A!=#0)+ H6 L9 u. L, @+ [" m, \& O
8 ?8 _2 W9 \! k( F
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):& C; ^* T4 Q( {9 m# o3 M# d
$ N; Y* C1 ^+ s, aT==#2 % d% }- V7 ~+ E
2 S5 @0 i$ ?* w
以上内容来自fceux自带的帮助文档说明 |
|