签到天数: 1902 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
; Z+ z, _; V/ C, B/ J# zConditional Breakpoints y: I8 H8 \- O. s( [) E
; O2 a( i* E& @) t9 @; E% N
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 z3 ~; _; u0 M4 u- X
) e }; j8 T& C4 UConnect -> Compare { ('||' | '&&') Compare }
m+ b5 [& v2 \2 Q0 ?Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum } ( G) \0 p) D6 E; q- D" t
Sum -> Product { ('+' | '-') Product }
$ d& F% `- C6 f8 sProduct -> Primitive { ('*' | '/') Primitive } & @( ]! O8 u9 K# j: ]; f
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')'
& I4 u# T6 ~4 f) @6 _Number -> '#' [0123456789ABCDEF]* 6 ^+ D- s# D h- F) F
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
. P. S# ]6 B: q& }8 X* \0 R0 s& hRegister -> 'A' | 'X' | 'Y' | 'P' % t) X: K+ `$ z! _! `" }
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V'
! \3 o$ q7 ^; s: pPC Bank -> 'K'
4 }1 Z+ c5 P9 }# E# P Z' m j' K' qData Bank -> 'T'
8 }/ A, e; E) Z0 f* {* N
; y6 ^5 {% D5 h' vThe 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.3 r# t0 z! ^! b4 M
; }5 ?& g, x1 A8 l3 B8 X6 x5 V
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.
& V$ C# v- [ O
) |* x8 D3 r: c. S% S9 e& l) fFlags evaluate to 1 if set, 0 if clear.
" e/ n' V2 \" m) t
' t, A3 {$ [# N) u0 r! VConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.
9 W8 t) N, E j3 X7 ?0 d6 t
, F4 V9 ]. E! ]) L0 U- ZExample conditions:
+ @) q- S( n8 {/ ]. Q) _& |0 W
6 q$ m# K! s }: a% sBreak only if register A is less than value at memory address $0005:
% b, g2 w- h8 l* b% I2 t1 ]' u$ d& l2 ^- c2 Z5 n$ L
A < $0005
( k, j- t" l* M" |2 |0 {* d A, a# ]3 H* O1 h: Y( H7 N: O3 B
Break only if the value at the indirect address is not equal to FF:0 Q- @/ o; U, H) t7 N f* B. ]4 m
& b: `( T, V- l* h
#FF != $[$10+($11*#100)]
9 W6 [2 c0 w1 e7 ~; i) I* P( `6 F0 Y# e+ ^: a+ A' L) `
Break only if flag N is clear or A is not equal to 00:( h3 D; k, l7 s- f0 {- ^
+ q/ F) ~. ^; g6 K" [9 f
(N==#0 || A!=#0)
0 C' g; G" a5 t$ L* {% X9 w* F. h6 f6 Y/ M# P
Break only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):7 ?( D, o1 G3 H
A. F$ [0 n* s
T==#2
* u' a" f0 v \) r8 s0 N1 Z) X0 ^" g% t) X2 ?5 w8 S
以上内容来自fceux自带的帮助文档说明 |
|