签到天数: 1865 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
- Z" R& x, Q% w. e* i% f! k( k5 jConditional Breakpoints
% m; u3 m5 a' A6 E
4 \2 R: P2 n2 @8 T9 U% EBreakpoints 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:) Z* R0 x! q. O5 j2 E, d
* R, [8 M1 J( s5 B/ pConnect -> Compare { ('||' | '&&') Compare } 4 y' {( z/ e& s4 y7 c# l
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum } 7 O* i$ y, k" A& f% l
Sum -> Product { ('+' | '-') Product } : X( f; e( D+ Z1 W1 d/ u
Product -> Primitive { ('*' | '/') Primitive }
! n' \! `5 L& f* M$ VPrimitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' 7 N# c8 z3 f6 T, F7 V7 K G
Number -> '#' [0123456789ABCDEF]*
+ V* b% h. C3 I$ P( x$ vAddress -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' , z8 a% F8 U: M% o [+ y, `
Register -> 'A' | 'X' | 'Y' | 'P'
/ e' f2 w4 X4 t/ z2 l1 n" a" LFlag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V'
5 H5 r' A- P1 l$ e* mPC Bank -> 'K' 8 `4 F/ O- x) w
Data Bank -> 'T'
* N6 A( W* j3 @2 b9 ?. G
% U% O# Q6 Z7 gThe 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.* r0 a. b4 ^% d8 e% x5 ?6 n
$ ?: ~7 Q& W: L$ f, S0 x7 w* H
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
/ v3 [0 m( e: U0 A5 ?% x
1 Z+ ^- @- x2 Y/ P3 M! uFlags evaluate to 1 if set, 0 if clear. L% Q, Z" ] L
; G# K ^6 H& i* a% \7 m3 J% U0 i! lConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.: _. M" K& i7 n/ u! h
( a" G8 u" g7 b2 A4 }Example conditions:+ R# u- J1 Y; \6 h1 o1 Q
5 p5 Y' x r- t: J/ T% ]) wBreak only if register A is less than value at memory address $0005:
) w/ X: _# k9 y5 P4 v3 H$ G3 J1 a1 v& t# T7 ?/ Q
A < $0005
+ ^# U, o# R; r* V$ ]" |3 p, b- L) U; m7 J6 x, C4 m: o
Break only if the value at the indirect address is not equal to FF:
` x1 G% s1 Z! ]0 { _) ?8 i3 J% S4 Z2 ]5 G `, p
#FF != $[$10+($11*#100)]" z4 @. ]9 r* E8 p+ N; ?, q+ t5 h
. w" |. M9 Z! f X6 a1 x( T
Break only if flag N is clear or A is not equal to 00:
' K6 n; ~! d% q9 q$ W8 W& W
0 y5 y9 [; n: L& Z( h(N==#0 || A!=#0)
: V7 v! P1 s% ]. S7 M% X# N$ T" g& L5 C9 n% z2 P5 W# O& s2 q
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):" S- [! ~8 k' W7 A" C7 A
* X" g* Z3 G/ Q; l9 p9 W+ M( ~
T==#2 & X, i4 k G) K6 E# J3 @. `1 `
5 p( d6 J6 d/ K' G9 {$ x6 t
以上内容来自fceux自带的帮助文档说明 |
|