签到天数: 1604 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
9 R/ M4 H! e rConditional Breakpoints
- y9 R! R+ J! N8 P# W
8 e) G( X9 ^2 q" u' GBreakpoints 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:
: }. i3 p5 [1 g4 S" p6 \6 |5 \
- U' Z; \ j$ K6 A8 ~( k* WConnect -> Compare { ('||' | '&&') Compare }
1 P, i8 A/ G8 N0 z4 H- E3 gCompare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum } 0 M. d$ A9 |3 z) `$ P
Sum -> Product { ('+' | '-') Product } / A/ c! l9 W8 S. [( H) Z1 a) r4 q
Product -> Primitive { ('*' | '/') Primitive }
# w) ~2 O6 u+ t: F, sPrimitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' ( D' ]- c6 y9 A& @- c- }6 a X
Number -> '#' [0123456789ABCDEF]*
$ Z" N t ?" E3 M( P& sAddress -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' / L5 z" S3 K. D: ?: q
Register -> 'A' | 'X' | 'Y' | 'P' 3 J) d9 L% Z( |5 ]2 G% G/ H
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' 5 z a5 ^* R8 }. t- h
PC Bank -> 'K' 3 t7 w4 A; ` S
Data Bank -> 'T'
% F9 t8 F% J$ W% d y8 B# ]8 l7 K0 C. y9 H/ V' u9 ?4 t3 o1 x& w
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.
# U5 I% y4 g3 Q2 N
" x. i+ p) E- ]; @( jRegisters A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.8 Q9 ?) `& R( \) X' ]2 }/ i
5 ^8 t$ l3 ^& W; P
Flags evaluate to 1 if set, 0 if clear./ S2 X1 c1 S! g" S9 W* _ w
2 K! o6 r+ @" N( k z8 A) O: H2 TConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.3 {& f/ b7 E( U6 y" |/ ~
! d$ U- N k* l# x2 Z" N' }
Example conditions:3 h, P+ `; f. ~! F8 {1 S
I/ g7 O& t* z- B; \1 g. SBreak only if register A is less than value at memory address $0005:
4 B+ w$ Q2 n0 w6 J$ w2 M4 y" v4 [
A < $0005: n) n8 }0 U$ i. M' q. m
5 J( u0 h" J8 e. n
Break only if the value at the indirect address is not equal to FF:
9 w, `# `. y) K" H
5 A$ U2 ?. c; d$ n" _#FF != $[$10+($11*#100)]
! f, h4 \" c( ?$ Z' e d
9 K& Z3 O& T1 T/ g* OBreak only if flag N is clear or A is not equal to 00:
3 c) V4 r; I! N& t$ a' R. b
+ H2 P. G, p0 |) s, M& u. Z(N==#0 || A!=#0)! c' m* |) q% p" {: i% S% f
0 Z8 L% C4 c8 [. eBreak only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):
; t+ r' D* ^$ z. c; f Y: Y Y* s0 G0 h5 M( E
T==#2
8 o7 v, ~: N9 }& V2 E( ^2 R3 a& C7 ]3 q3 L2 E ^) ]/ g
以上内容来自fceux自带的帮助文档说明 |
|