签到天数: 1927 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
- k/ p; u- t* O+ k% P' m+ lConditional Breakpoints, b1 \8 t" }3 i8 k/ ~4 f/ m
# w, ]. l/ A# s" `
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:
1 r. C0 W6 R* w/ {! V6 X# L2 {
9 m% }9 f: _ A1 c8 oConnect -> Compare { ('||' | '&&') Compare } 7 K% L. x2 M8 Y0 m+ |- r8 _0 n* k
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum } # M; [. K7 B' t! T& g
Sum -> Product { ('+' | '-') Product }
! i9 N& S0 R4 K# Q; r( nProduct -> Primitive { ('*' | '/') Primitive }
/ j8 B$ ?3 }* M+ IPrimitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' + S- j X2 X# }/ ?7 x Z
Number -> '#' [0123456789ABCDEF]*
1 A6 u0 W" @% m7 ^: C7 LAddress -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
" P) G; N# P: q* DRegister -> 'A' | 'X' | 'Y' | 'P' : W6 S% @+ z9 D$ ?" Z
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' 1 m9 C" W" l- p7 v% {3 o
PC Bank -> 'K'
* T- h& t- B. n# L( O: |Data Bank -> 'T'
( F4 j* J, Q( X( O. j% B b
7 G- z$ [% ?2 d8 `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.; M- s& b9 R# ]8 O4 U
[2 P: B! F5 q7 G5 \
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.* Z( ]4 b3 A* I# t% }* B( |8 B
# T% A" V _: c$ a$ {0 JFlags evaluate to 1 if set, 0 if clear.* @& x/ v; O q8 f
9 p! w1 d" H# Y4 r7 N, r' r6 a3 b+ gConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.
: q, m H$ e- W& ` p2 @6 O( a9 L0 n( ?$ J1 h* j+ h( b/ ~
Example conditions:
8 u. r; G. e5 s. `0 U0 o* W$ J2 e. l) x. }
Break only if register A is less than value at memory address $0005:' r/ v+ i. c* F" d! T- f* D; N
3 @6 m( L3 U+ A
A < $0005$ K6 L+ X. k# G6 l S1 A
; ^0 j9 P M) v7 g+ K# PBreak only if the value at the indirect address is not equal to FF:
5 L* t/ z" w5 Y P9 A& [' z3 P" ]8 {1 H* Y# j4 V- W# E$ W
#FF != $[$10+($11*#100)]
+ j$ c; ]' @& ?0 H5 H
7 h' o) o/ {4 V6 ]! a# A5 VBreak only if flag N is clear or A is not equal to 00:
) m, z) E& y) B! ?% i
1 M6 |8 K2 }4 I' Z8 J9 H(N==#0 || A!=#0)( @! m E! W2 H2 o, e! u' ^' ]
, r6 i# _9 B' }" g
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):
/ s5 ~: W# E/ E5 n0 m" P
1 u* K8 G! ~- ?5 w. kT==#2 & A- R3 V3 S9 T! P% `7 f
3 N0 t: \) `& O以上内容来自fceux自带的帮助文档说明 |
|