签到天数: 2141 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
/ E. Q0 l! o" H0 A1 HConditional Breakpoints. M$ B( ~$ ?1 ~8 O6 j5 c8 Y
3 k* ^; V# q8 x* oBreakpoints 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:
* T+ z% p6 `; P. e4 A
2 i. t/ d3 V! o+ ]- v8 zConnect -> Compare { ('||' | '&&') Compare } ; f5 z) Y0 Z+ I6 r. g
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
2 s3 [% A9 ]1 G9 j, eSum -> Product { ('+' | '-') Product } # T. v* l4 o8 {( {' i: H: C
Product -> Primitive { ('*' | '/') Primitive }
( z# U3 n( O- X( n4 W5 ]1 M8 |Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')'
- y- Z! }0 q XNumber -> '#' [0123456789ABCDEF]* 4 z) ^% H6 k+ J; [) w3 z
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' : {" E* g5 ?0 Z0 E- _* k
Register -> 'A' | 'X' | 'Y' | 'P'
* j, @& |- S- c4 `! WFlag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V'
& Z: l% w3 ]/ t9 O* KPC Bank -> 'K'
' J4 V) ]: H& A5 _5 y- jData Bank -> 'T' # }& z {; s# h: l( U7 n) A5 j/ d
: f+ R( ^5 r# f1 s: d
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., @$ g* [! }4 W- U, l9 N* a
7 m# b8 Q7 g! i+ [1 _$ O
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
+ w8 T1 q" o1 V% z0 v$ h4 F$ } d7 |4 M4 l2 P
Flags evaluate to 1 if set, 0 if clear.
4 t3 Z& m' ?* |, J# a5 l; V# O! t+ u
* o; v' k0 L- G. M) G# l9 f# i8 z; ^Connecting operators || or && combine boolean terms. Parentheses dictate order of operations.
; J1 N P/ q, o7 t \# {$ h1 O0 Q9 m& w7 n
Example conditions:3 r$ ]4 Y( _3 J- [7 ~1 a, P/ _" c" m# p
9 i8 j4 L4 l) R9 h9 z$ a
Break only if register A is less than value at memory address $0005:
: |) L' t3 U; F. ^& W. f) I6 ^1 E2 ^& j- n- h7 k
A < $0005
) I% a# L" U" ?% l& H0 v2 P) t% T0 [% N5 [( P+ X( I5 U0 R2 Y7 ?: y
Break only if the value at the indirect address is not equal to FF:
6 r' z, x7 H% {' H# F
+ J0 }' j; f E n. @+ O% f#FF != $[$10+($11*#100)]; F+ m5 }8 O/ H
& ]1 `' r2 u1 n4 M, ~# d1 a
Break only if flag N is clear or A is not equal to 00:
/ t3 b8 Q5 o9 _0 e" s4 C0 L- G$ o; H; {1 b2 |. X/ v- j+ F1 Y! x& F
(N==#0 || A!=#0)2 A3 A! ?% ]0 x( `
, ?- Q* d: A3 DBreak only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):, o% R. r `; A7 a
$ E& k1 F5 H1 z( j4 R
T==#2 1 D7 G% _, c3 ?+ }7 R
+ u4 m. e& l; ]8 }! ^
以上内容来自fceux自带的帮助文档说明 |
|