签到天数: 2136 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
/ ^: X k l! {) n5 ^9 lConditional Breakpoints
' _5 v8 \; @1 P8 H' \& j4 f3 I" F0 x# u7 e, u( j9 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:
5 z1 n: r6 F9 C* F; n1 Q8 T
# ]2 y' K/ @& A* ?! JConnect -> Compare { ('||' | '&&') Compare } 5 x& [# E$ S- P, K
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum } & G9 c" S* T" A& \1 h# C, ]
Sum -> Product { ('+' | '-') Product }
) R# B6 l/ v2 IProduct -> Primitive { ('*' | '/') Primitive }
* T' J. c8 W7 t+ EPrimitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' ( @2 l# i$ F% g4 S% P3 Q0 m* l1 {
Number -> '#' [0123456789ABCDEF]* 6 \$ U5 D5 r0 ~: E. k# K
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
& b$ P' j" o& y! m$ b. f$ sRegister -> 'A' | 'X' | 'Y' | 'P' ( m7 D) ^& w0 w) g$ F; E
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' 0 {# o7 K8 U5 R( B3 W2 c# R8 b
PC Bank -> 'K' 1 F0 q( T6 E5 ]& o
Data Bank -> 'T' 2 o' `3 q2 s' t/ Q9 c. v
1 ^0 N; o) f. M, K% b6 V
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.' a$ {: R9 D U1 {
9 W; P+ c v/ U5 Q) uRegisters A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter./ g. N) X6 K: r% }" C
; H: Z8 u9 v* n9 a& m& sFlags evaluate to 1 if set, 0 if clear.( P: H$ L$ w$ H1 b$ _4 U
' v# i9 L M- X7 m1 C, g z9 S! G
Connecting operators || or && combine boolean terms. Parentheses dictate order of operations.
" \1 |% i+ a+ f" P& [; {* c4 @; b2 Z6 U3 `' l
Example conditions:
: H7 V' `+ Z1 T/ J& k
$ N$ m7 Z4 f! z7 s! T% G4 Q: e( vBreak only if register A is less than value at memory address $0005:
- ], l' W+ z' \; Y1 L7 Z
2 w2 S: w; b3 I$ c/ K1 W; }" SA < $0005
3 ?: ^3 N- L6 g: I4 e# u
2 I# o8 t/ \4 Z. U R. y, V* \! n UBreak only if the value at the indirect address is not equal to FF:& Y0 P5 m8 q8 \5 Z/ f4 ~
$ K8 U% r" u% ?3 A7 E4 ^6 Q4 {. e#FF != $[$10+($11*#100)]
# Z T, ?% ~0 X' x1 y" p* R" v; G3 Q
) G( [/ T" S! S3 bBreak only if flag N is clear or A is not equal to 00:4 a! M- k! w( t- I# p$ o3 g# [4 C0 l
* F3 |% m5 q' Q- a6 X1 b/ C" Q) B(N==#0 || A!=#0)
5 R( ?6 o% }( M# P# a( o) V" [
6 a! g5 B; y4 ?; {7 RBreak only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):+ |+ \8 A4 t y; S* y
6 `( d, b" I- x& j; ^$ {8 KT==#2
7 G8 o9 X/ C* F4 m' G- F( i+ R; V( V5 ?4 z
以上内容来自fceux自带的帮助文档说明 |
|