签到天数: 2185 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点! L0 y) D9 U: P% `
Conditional Breakpoints
# |# a @* s8 C$ P" a) S3 j! b$ C6 {7 K' b0 R0 o v
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:
" \8 v/ n r/ ] F: E. ~
, r* o( d& G0 o4 h, @Connect -> Compare { ('||' | '&&') Compare }
) m/ ]- l6 m5 h BCompare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
; d) [0 Z+ u0 {( o# I+ I- `Sum -> Product { ('+' | '-') Product }
~1 N4 [- w! i1 pProduct -> Primitive { ('*' | '/') Primitive } 0 v% f0 A' K, H; J# Z3 h" H( y
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')'
& q. Z0 G" c/ e; A/ p" f$ O, ?$ ^Number -> '#' [0123456789ABCDEF]*
+ ?1 M- N! u x" _7 eAddress -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
6 I4 L4 Z7 M. _( bRegister -> 'A' | 'X' | 'Y' | 'P' ' Q6 @: S5 ^- e+ {$ g% ]
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' 6 j, s+ `9 j$ Y# v# p9 I4 j. x0 N
PC Bank -> 'K' + Q# M- I$ u. i
Data Bank -> 'T'
3 Z7 |- O8 e1 S$ \7 |; F- i. j3 e4 U$ n# c1 E- V; ] Z
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.. O/ [+ _2 u2 U5 F
7 ^+ k* Y: q' u4 d. E: G9 O4 G
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
' u t& d$ A" R/ i; f0 f1 M
, ]* K. G! V" G9 `' W: a1 @Flags evaluate to 1 if set, 0 if clear.
% N H: M4 \: U; g. T6 s
! ]8 r1 u- n! C" RConnecting operators || or && combine boolean terms. Parentheses dictate order of operations. C5 }( K& k1 t# e
3 f) S1 F" R2 }' k2 T% r" pExample conditions:
' P* ^ p; i. q$ d6 G9 ~( g
/ Z# G: f- R L9 h# bBreak only if register A is less than value at memory address $0005:
6 `' _8 R8 p& q7 p) K4 W |$ b
2 L$ R6 I! J+ n' k) A1 G5 t+ qA < $0005
4 S) x9 k, Q5 d! V4 |6 _
9 J' s' a$ B q/ Y; W9 D" ~Break only if the value at the indirect address is not equal to FF:. y# b$ \# t% m/ {1 y
. z: s9 M) V: k; C: E% z$ p' i6 D
#FF != $[$10+($11*#100)]1 d8 x# y- g# |# L
! ^/ F6 u) `8 X# A$ U! K: D( kBreak only if flag N is clear or A is not equal to 00:
5 S: A5 l4 b- g+ F5 I( |( I @ J7 A, Y2 m8 e+ j
(N==#0 || A!=#0)
; ^! K/ E- K! ]; [/ Q/ R
, k p4 M; N2 o% ZBreak only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):3 S9 g1 K% l3 f, M4 }
- u7 `/ l7 ^, I: ` ^: ST==#2
; W R; M9 h0 k; ?1 a% d3 C, V8 u
& s3 O. O% t2 s以上内容来自fceux自带的帮助文档说明 |
|