签到天数: 1996 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
+ [# S9 A; _$ U2 S/ u( @5 f/ k' oConditional Breakpoints
4 V O( u, H: U) @ m, N+ l3 v# J& Y3 r$ g% i/ g
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:0 ~5 j! S3 L& B* ^7 c6 P
) a! W8 T8 H' J# F- x5 N# kConnect -> Compare { ('||' | '&&') Compare }
8 r* C/ y% ~# J1 k1 B: bCompare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
7 `* V7 b- N; k* F, z1 jSum -> Product { ('+' | '-') Product }
; P% \* K) U! r/ z5 EProduct -> Primitive { ('*' | '/') Primitive }
" D) j# z2 }5 e0 B+ }$ hPrimitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' ; V+ `) u6 f5 z) E( { r: \/ p( D# E
Number -> '#' [0123456789ABCDEF]*
: h# k+ b8 s1 Z1 C+ S$ C2 tAddress -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' $ D+ k9 v0 C4 P9 v7 |# S
Register -> 'A' | 'X' | 'Y' | 'P' 1 T4 f" m" \0 m9 w. I& p- z- T
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' 2 ~8 }0 T# d$ A/ v
PC Bank -> 'K'
4 b2 z) E. K' P' iData Bank -> 'T' / A* t/ j+ D0 I6 N& a4 |- l
o3 s- j: C9 t QThe 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.* V0 K6 e# j. J/ s
; F6 p# G# b% E* C8 I# Q3 m7 K" U9 t/ }Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.3 S6 |) r4 G8 n4 ^/ [. u
+ {- |2 Z( b) n3 Y. nFlags evaluate to 1 if set, 0 if clear.+ Z' \" P7 S/ n% m* q9 i
/ F A2 M( K+ x o% ~4 w& WConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.+ S& ~' R6 p& e2 y9 i( V
* P+ n1 Y% a6 g: y& I* p
Example conditions:
3 P+ z( I8 G9 S, a3 W6 S2 L( ?; a# R, H: [7 q$ }$ y& `$ o: `' J
Break only if register A is less than value at memory address $0005:6 G/ Y- y2 s' O2 u* G5 q5 I6 t5 x6 z
~" Q" K' q) f" e1 eA < $0005( j3 `7 y# }% X, k
4 q. {) d& g# o( @# K
Break only if the value at the indirect address is not equal to FF:
& T% b. ~- l% i# C$ r2 x6 Y! |, {7 ]; d: F% I( N
#FF != $[$10+($11*#100)]" _ c3 {1 Z; Z$ D5 ~+ @, G! W
- c5 y+ ]$ [* F% @/ ZBreak only if flag N is clear or A is not equal to 00:; h, K3 Y5 D) `( B |
- w! `/ m9 u5 k! x/ O0 e+ `
(N==#0 || A!=#0)7 n$ z% c5 ^' O6 u q2 O+ i
2 c$ c6 K( s" q; ^* ]' O8 EBreak only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):' V+ @( i7 H2 u8 R
; X* t% V; |% A+ b4 }- mT==#2 ( }* S9 ^- ^% O3 s; [2 c4 `( o
* J/ C j& g; l2 ]% a以上内容来自fceux自带的帮助文档说明 |
|