签到天数: 2148 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
/ S* `- D* J7 W4 \' jConditional Breakpoints# X, {: F% f! B; y
- a* Z$ a; I9 B& }' K7 f
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:
! [) @ W. @0 W- u7 [; R
2 }0 B" m( G* w. {Connect -> Compare { ('||' | '&&') Compare } 5 D( |5 O! t7 W V5 Z
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
7 ]/ c# b. \- m; V, zSum -> Product { ('+' | '-') Product }
. [7 }9 B2 B x" A9 E. o5 B: PProduct -> Primitive { ('*' | '/') Primitive }
1 h" i: a8 }6 M2 ~4 V; M9 s$ LPrimitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')'
: B# H, z, K8 X: o$ CNumber -> '#' [0123456789ABCDEF]*
M3 |9 s6 S: u, qAddress -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
; l: u D: ]% A- CRegister -> 'A' | 'X' | 'Y' | 'P' 8 z& D" e' U4 W/ K0 t+ A' L/ Q6 v; r
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' ) S9 @ e5 w( @8 u
PC Bank -> 'K'
_. T& X/ f9 }Data Bank -> 'T' 9 A: y* M5 [+ @+ x2 G4 z7 T
4 O' }+ `4 v% M' z( \% w. `2 H5 |9 KThe 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.+ U1 c! ]3 K% X+ W, i
8 s3 R/ p% Q1 }
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
5 F- h( x0 R" {% z/ ^, m* R( \. I3 C3 q1 u7 N" d9 [5 n9 d
Flags evaluate to 1 if set, 0 if clear.6 c& ^. z- m' k/ e, `
' }8 E* U4 P0 z( z9 p% n( PConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.
/ A8 e& C' u7 j5 F' _, [; p* f1 v4 ^+ t0 w# W1 Y l, Q; ~6 c! m
Example conditions:
' D% X5 j: t" ?' O$ _0 \% t' \4 M
Break only if register A is less than value at memory address $0005:
$ X" `: ]- u n% v4 T4 v$ f$ A' k" O9 ~& m# T$ y6 ^( N
A < $0005
" K# k7 n$ `" c, u2 C
0 B; I ^0 J9 Q& z6 F' uBreak only if the value at the indirect address is not equal to FF:
6 B i) p1 F4 F
7 d; h/ n' V5 M9 g! i0 I#FF != $[$10+($11*#100)] r( w5 R: _% o* B
6 q0 `. t3 U9 X. w+ W$ F0 O& k+ ^
Break only if flag N is clear or A is not equal to 00:/ a- j1 W7 ~' m+ Y$ r2 a+ F2 D& j
`6 M1 H) T8 g. \7 c y \7 l(N==#0 || A!=#0), j# _' J7 I) D7 U
7 }/ I8 F1 J7 Y
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):6 N- D* {! V3 t4 I$ u8 g% }) _/ K
9 n7 N8 O2 Y% ~' S: J
T==#2 * o% W8 I* M0 j( m M
7 o4 v+ i' u- n/ n2 {0 N以上内容来自fceux自带的帮助文档说明 |
|