签到天数: 2072 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
* c B2 Z @, L+ V. H3 p8 a0 vConditional Breakpoints
, |3 e9 J, ~! H& @% d. n' ^5 M9 v* @- e4 H- x$ y& p
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:
/ }3 X4 _! |( y9 o) y8 s' S6 J) g- `. f- _9 j) W
Connect -> Compare { ('||' | '&&') Compare } * k4 J. m- j7 o# T- }# i* D% t
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
$ M3 J2 q- C3 e9 l) BSum -> Product { ('+' | '-') Product } O" }1 H3 ~3 J# {) g; V `
Product -> Primitive { ('*' | '/') Primitive }
) Z- w# m' O/ p Q+ ]/ XPrimitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')'
) S& M/ ?* ]1 ~* ENumber -> '#' [0123456789ABCDEF]*
( s; ]: R7 y! b- I7 {2 ~: AAddress -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' / \# t& `0 T2 D; e# S) N
Register -> 'A' | 'X' | 'Y' | 'P'
8 [/ V2 `9 a6 b/ TFlag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' & g2 u& t& g Y8 g
PC Bank -> 'K'
' G8 T4 C5 n( U) r; [Data Bank -> 'T' . e% d+ f" G. R6 m5 ?
+ e+ l0 f* b/ y Q; F9 ?
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.8 u) `$ ^# N. e0 {- ~
6 _7 I3 v3 y) U1 C: {6 G: g
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.$ |4 r- X7 _' z" N6 }) p
1 X& l" X r% C( {+ s% V( V1 t
Flags evaluate to 1 if set, 0 if clear.% g1 }$ }' T3 ?/ Q
6 x0 Y; A, ~. |6 P: ^Connecting operators || or && combine boolean terms. Parentheses dictate order of operations.; o4 s1 p3 [5 w. F
, o( n7 B- A. e* E# T* B2 `( H* SExample conditions:
" {# e* z6 Y# f4 `
7 P: f6 p z, p7 ? T+ B0 GBreak only if register A is less than value at memory address $0005:, |0 P, C- @; k {' I; J
7 J; U, c6 z a h
A < $0005
' E$ c- Z% K. _, Z( @) J# K: F" @6 \
. _, u7 t0 a0 vBreak only if the value at the indirect address is not equal to FF:
5 t3 l) A5 V. I
# C3 ?) k. c: a* a9 j$ s0 }+ X4 J#FF != $[$10+($11*#100)]
1 \# C( G7 b" k1 X# q( D) A, i4 f6 h ^3 c4 G
Break only if flag N is clear or A is not equal to 00:0 f& k& x1 F6 X; ?' w) A
+ o8 u* e9 D" r' z+ i(N==#0 || A!=#0)- C4 D, J2 h! `& r
( E, Z& u! x! u+ v& y' z
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):
4 A4 O7 P8 n3 `2 t4 O
& O+ f# A# u RT==#2 1 y& [1 i3 Z) v# V" [2 B
( ]) T |9 J$ l以上内容来自fceux自带的帮助文档说明 |
|