签到天数: 2192 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
% }! }( k4 }- i9 u* i7 wConditional Breakpoints+ ?6 C( _, D+ |) e" B' p( u
4 t3 F) R! O- h7 X/ ^( u8 g+ m
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:2 R9 N/ G# l* y& _' q: U6 O
7 Q) y1 S% g4 P+ {6 a( @
Connect -> Compare { ('||' | '&&') Compare }
8 W1 O% n1 s9 l4 ] B" ZCompare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
F7 d; Z* U r: A/ u* jSum -> Product { ('+' | '-') Product } 3 _7 J% \2 F8 g7 V
Product -> Primitive { ('*' | '/') Primitive }
! w1 R/ M* S, E# l7 tPrimitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' 0 {0 N% v I! U) _$ c {+ N% _; r" T
Number -> '#' [0123456789ABCDEF]* % A" f/ y( O) f$ z6 x
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' 2 }) M6 T2 n0 ]1 ~! n/ ]' W
Register -> 'A' | 'X' | 'Y' | 'P'
. ^( C+ H. S8 VFlag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V'
/ ^+ \% ^- L- S* a( d, o ~PC Bank -> 'K'
* g& {$ ?# G: d3 _" v7 tData Bank -> 'T' " q/ n, _$ l% k8 H3 A
) D9 t% }' j" o% f2 M6 jThe 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.
, j- f p5 b4 t$ A' p% t( F/ n; `& P. p1 e, S7 @( O1 p/ |& A) o
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.& y5 N& N2 k/ v$ d4 |
. B: d% n7 i. g7 E$ e( L! W) D0 Z- D: LFlags evaluate to 1 if set, 0 if clear.
3 x- y h$ o6 q4 h- g) E! f
: }/ N6 v+ n6 h. y3 i3 gConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.+ ]6 f1 J8 O- A( E" e
4 t( v, b$ M9 Y% k' c$ QExample conditions:
! S- y$ x9 f& ?1 I" y, N7 U0 Y6 {
4 S3 U7 O' d, y5 xBreak only if register A is less than value at memory address $0005:
. J H( s" k0 ~% k4 a6 Z& Y: O7 H( a9 t% V, U7 @
A < $0005' [4 I% s0 r/ K/ s
, C" g/ @6 b8 Q6 V" z/ G
Break only if the value at the indirect address is not equal to FF:
: y$ |( d4 @5 {$ Q) r: Z Z- {8 O: {$ o% p
#FF != $[$10+($11*#100)]5 m* K% Z& z! ~0 p4 h
8 Z! L; y, y/ v% ^. H9 s: f
Break only if flag N is clear or A is not equal to 00:
$ K( v9 J) B5 @" [9 G
+ l# D6 X) ^9 o% m! u! F(N==#0 || A!=#0)3 N- p" i% b0 {- ~8 ]$ @ T
* b8 o" }0 T6 d. F1 h) u
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):" V) P/ y b0 h) a I8 J
1 y( {' I/ w2 `' }! L
T==#2
- N9 j2 w9 [/ p& M. n
: z, M3 S' P; W2 A以上内容来自fceux自带的帮助文档说明 |
|