签到天数: 1867 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
6 o) P9 n$ A$ j9 h' K4 jConditional Breakpoints
4 y. b7 W1 t5 c ^5 {) E5 {1 u1 q2 \6 @# A' Q1 m6 k5 ]; A
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 f j. E2 H' }. E5 g9 ~/ q
r8 P& Q0 \0 {3 u' _Connect -> Compare { ('||' | '&&') Compare } 0 y2 m# X6 w4 l1 }/ f4 v# p
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
5 P- ^6 U% ~4 VSum -> Product { ('+' | '-') Product }
% p! |/ M) `9 P6 k& H4 ^% `' YProduct -> Primitive { ('*' | '/') Primitive } * v" Z5 M% o( Y) F. _9 t
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' 2 ^# Y' U" A: }0 u
Number -> '#' [0123456789ABCDEF]*
4 i7 L5 ?0 b% J: t- B2 A) N' ?% dAddress -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' ) r& G: j2 z2 F+ N
Register -> 'A' | 'X' | 'Y' | 'P' ) u' P0 R& x; j5 ?+ O. k, o
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V'
; T8 p. C( ]- ^9 zPC Bank -> 'K'
( U4 ~3 R/ i6 I0 S- f4 oData Bank -> 'T' / r% l, l2 {% R+ D
( F2 Z1 V( A$ _/ A `- |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.
4 F6 G4 ]% W4 v @' P1 ~- R( N2 ~/ f- x. \. O* P' A+ H
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
7 l* S. y0 c) @! \; r, w: Z, _7 m2 {) |
Flags evaluate to 1 if set, 0 if clear.# }& q7 c$ S+ _' Y
3 `1 B2 f1 W& Y( bConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.
! s# T! ?, ~ _/ @8 \+ f, m$ v& l P+ C6 K3 V c9 J8 F
Example conditions:/ W7 r4 }6 y" ] r& L' G
3 `* v9 X3 _- D `) [5 ?* n' I; @
Break only if register A is less than value at memory address $0005:
+ D m; p+ _( M5 s5 H
6 [, ]8 ~; ~# L+ a- wA < $0005
( b+ q% ]& |2 H/ i9 a) `! _1 l$ q$ G
3 _7 D4 i5 A8 v9 L ?% WBreak only if the value at the indirect address is not equal to FF:
# C$ i- u0 F2 g4 o& s
# H# \7 w0 ^! r0 b# c#FF != $[$10+($11*#100)]
6 b5 }/ L& O) t7 E# T2 ^
# o: ^) ?) R' M' `. j2 a& gBreak only if flag N is clear or A is not equal to 00:% v3 {9 A/ h0 J( g6 ]
9 x+ K8 q% R& `
(N==#0 || A!=#0)
- T9 l) G. L: V( b/ w7 O7 v" g2 E, i
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):& h3 r0 U! Y4 ^2 u5 e
2 d3 I n8 o3 S/ I* E8 m
T==#2
1 ^7 ]# c: m+ Y9 Y% \1 l! ]. z
( @& u7 T. i# r& n" P I! {以上内容来自fceux自带的帮助文档说明 |
|