签到天数: 2124 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点, r4 K8 G$ p& h$ Z- L- V
Conditional Breakpoints$ D0 X* r$ L3 K' F
( e' @+ v0 r6 _8 X% T+ D; n4 _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:
; P; o$ K: C3 b# x
* M( M: _2 {3 ?! m7 w6 dConnect -> Compare { ('||' | '&&') Compare } : R9 I& v T* R0 Y! E6 Y7 \; }( ~
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
" a* p" }1 N0 N' r5 \7 iSum -> Product { ('+' | '-') Product } ! V p' ^3 S R& t) S. ^
Product -> Primitive { ('*' | '/') Primitive } 7 v* K% A6 i) E: ^1 F7 |
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' 9 ]6 S3 m2 N* D. h7 x4 N: _) C
Number -> '#' [0123456789ABCDEF]* * x9 \: ^, A( B$ h
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
6 D5 p' ?" d6 [Register -> 'A' | 'X' | 'Y' | 'P'
5 X7 P, r% q( W# [2 IFlag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' . `/ N" E! R% }3 j! s& y. p& M
PC Bank -> 'K'
9 c# Z& Y; P; nData Bank -> 'T' 0 a4 o# l# }7 \/ @* q
7 l3 k; ]) r6 N% b' ? T+ w7 {
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.
& Y6 @5 [- h+ E4 e# p% R# G1 D3 y5 S% }
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.1 \* @' n. O* v" q
' B# x" _' C MFlags evaluate to 1 if set, 0 if clear.
% b3 H5 N' q1 z" u$ t8 {) @7 E8 v- ]+ r6 S
Connecting operators || or && combine boolean terms. Parentheses dictate order of operations.
' o: j' \3 H& i2 E0 \/ y; n) F& f2 j& s) ~: Q8 W
Example conditions:
: ~7 i7 e# ]% T, w- \+ T. h+ k. u: `. q
2 h$ G1 Q* ^& Q9 r/ _2 J& VBreak only if register A is less than value at memory address $0005:, e, I6 A6 A7 k. Y( S. P3 u! M
2 L% T9 `: u: j9 g. _. n
A < $0005
, H$ d# u% j5 l: H4 h% H9 _* E* U" A7 R' C$ f
Break only if the value at the indirect address is not equal to FF:
# M4 c1 h! r2 B" X
5 t* k2 m8 _7 p. H/ V( D* `) P#FF != $[$10+($11*#100)]/ }. v0 J1 K$ S, M1 ?. `" `
+ e8 T% m! X; @( I3 R: }
Break only if flag N is clear or A is not equal to 00:
9 Z7 Y. I9 S3 _; o* d8 d' G( T1 q) N; ]8 g3 D
(N==#0 || A!=#0)9 D! Z4 B; u4 w
2 T) q# P3 c+ x z5 tBreak only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):$ { r) R, {# ]' W
0 q* {/ l3 b9 MT==#2 5 {5 x, X( i8 a
; e" Y8 _7 {. Q/ U5 @6 l( g- y以上内容来自fceux自带的帮助文档说明 |
|