签到天数: 1773 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点8 \! j7 X0 Z- t6 a
Conditional Breakpoints
. N. q `. T1 F9 x1 W- ~
, Q: X9 k f/ Z# l& vBreakpoints 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:
# m5 G) ?5 e- E) {/ u' V5 h$ l3 y/ W# B& Z) P) L/ c/ O( I0 W
Connect -> Compare { ('||' | '&&') Compare }
" E) l! h* \0 h, h% @4 y% cCompare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
: R0 L( U+ f4 c6 MSum -> Product { ('+' | '-') Product } & k6 F6 C0 |/ a. X& ?6 t
Product -> Primitive { ('*' | '/') Primitive } 7 N. ^& U# U* }* J" M6 [) Y: ~
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' % J8 V6 o. j2 u; \1 x0 T
Number -> '#' [0123456789ABCDEF]* ~5 n, G _+ ?7 a: |- g
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
! F m; Z, x5 o, G# v5 m4 z& sRegister -> 'A' | 'X' | 'Y' | 'P' ) @9 i, W# N' ]' x
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V'
! w- S. p9 _; B1 s# IPC Bank -> 'K' 8 {: h0 B4 p2 Z% Q
Data Bank -> 'T'
" C- U. G' {- b' M; V2 t2 u M- }' O8 ]( c) q! \
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.! H6 h9 ]8 j% c F+ \
( f- y! q/ N4 o, \0 k3 X( Z
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.4 u _& j! ?& E" S2 M
5 S6 H5 I. c. d. t# Y: J; `7 S
Flags evaluate to 1 if set, 0 if clear.8 _5 X4 P7 |/ z: W3 I, p
0 n! a, W2 b. o7 G8 S( t
Connecting operators || or && combine boolean terms. Parentheses dictate order of operations.
6 P& _9 o5 ~1 F1 `/ q) u9 S% G' z U; n7 q4 ^) x% O& y8 R: y
Example conditions:
& H( s/ b/ V9 E2 i7 N+ L' z
7 N1 }& P% ?, SBreak only if register A is less than value at memory address $0005:
% a6 b) e$ h" e
. j$ c% f4 b" x) _A < $0005
8 `+ m+ S: D1 p" g" a, j1 M* E9 C6 ^3 Q0 v% n6 ?, S
Break only if the value at the indirect address is not equal to FF:3 z3 [; F- D: y
0 _4 n2 l, R: q
#FF != $[$10+($11*#100)]
8 T% V( `4 h) `4 \) n. K- ^! R. K: J" P& f# i0 j& A
Break only if flag N is clear or A is not equal to 00:
4 Z% \4 Z c" x. [
) ~. s6 S) c( |$ u: M$ V6 v(N==#0 || A!=#0)
/ `! n0 ~1 }2 ?/ ]3 Y& K0 p! E( H" m) v$ x" Q* Z
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):% p4 V8 x: H: R3 `! A+ R
* q- { }1 x" X/ c6 U
T==#2 2 J) q2 x/ M5 y# t
" `7 @2 V; Y. p; d" O
以上内容来自fceux自带的帮助文档说明 |
|