签到天数: 1938 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
! R; m* I( j h$ b, L( \Conditional Breakpoints
3 N- u) f, n S* R+ g3 H
6 t% X( N3 U8 Y/ nBreakpoints 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:7 ` K# Z$ K2 @2 Q9 l1 b) q
& M4 v) e: I; A8 g5 t3 `Connect -> Compare { ('||' | '&&') Compare }
+ y/ X$ n9 u& G$ j n/ ICompare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
6 H5 E1 p2 u; _* {* r7 B) |0 W& P/ K; ^Sum -> Product { ('+' | '-') Product } # i5 w7 s! i$ x: Z! ~# a4 Q
Product -> Primitive { ('*' | '/') Primitive } i, O. ~6 w$ x0 Y, T
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' 1 m. @6 j7 X2 c! ^6 T" v ^. z v, h
Number -> '#' [0123456789ABCDEF]* - _' D8 o' j) o" p# a, [
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
6 E% L, x, b3 j- rRegister -> 'A' | 'X' | 'Y' | 'P' ) M8 L. d U z& `; A# J
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' . O7 U" G2 Z3 r
PC Bank -> 'K' : @6 S! O$ N6 W, \; P/ k
Data Bank -> 'T'
8 \' F( ~4 X8 G0 |
, S; I# Y8 Z% O+ ^% mThe 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.( } A7 y' h. f; `- @5 s
8 i: S% W9 i; SRegisters A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.1 Q. N6 T& u. o& f3 L1 f1 f
8 h8 h: i. u* x1 o2 |. Y
Flags evaluate to 1 if set, 0 if clear.
" k! q" S9 l: j3 J1 o" q: k% G5 x9 W2 ]* Z9 r5 Q4 D: n
Connecting operators || or && combine boolean terms. Parentheses dictate order of operations.. p+ v" b& @. N" q n5 e
& @6 Q1 d9 N5 b7 u# P8 O2 ~, i
Example conditions:
( m+ s% |; F0 C- u$ P! v& d9 }* | H' u# `; Q
Break only if register A is less than value at memory address $0005:
1 [7 v7 R) J0 f' s- c l6 T
% y7 K5 K$ b9 J% |: h; d0 EA < $0005
+ o o6 n% r# Q" C! ~) z5 z
) ~. }& C$ U/ R' KBreak only if the value at the indirect address is not equal to FF:/ X7 Y. a* P7 U
" @: d3 [+ `. W' s" W2 I1 a#FF != $[$10+($11*#100)]* C+ |8 K3 q* @* W' U# o
. B! W0 b) B% u" z0 m( ~
Break only if flag N is clear or A is not equal to 00:, w3 b y) T( U1 j' O6 F
0 Q/ b$ T$ f/ j- J5 N. j$ ?! ^4 \2 ~(N==#0 || A!=#0)* d. J' Z, i- w; \4 ^* l0 Y3 c
5 k$ L6 x5 r$ t# x% B! B. m y
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):
/ F, g+ M5 C5 J! w7 F, V& N5 b% K% l1 q% m4 h
T==#2 - h2 A/ Z$ ?; t0 H
0 z2 }6 t8 H" L: n5 p Q% g以上内容来自fceux自带的帮助文档说明 |
|