签到天数: 2195 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点
3 Z, f' L7 P- r3 e& j, }5 W& }Conditional Breakpoints
- G5 }% [/ q( Q2 G* m3 n* E- S% L+ D; B. |# O
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:
; `% K0 F( M" Y) \, g# e
# \; k' ^: o% S8 D6 ?4 P: J# DConnect -> Compare { ('||' | '&&') Compare }
, a1 \) J' P+ E' }6 i0 z2 a' GCompare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum } 8 g8 {* _4 }: C+ k! L
Sum -> Product { ('+' | '-') Product }
* H6 O) b& G2 T7 j1 U( H, A+ ]Product -> Primitive { ('*' | '/') Primitive }
1 `1 t! K" A# }Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' ! U3 N2 z- c% @! U% F
Number -> '#' [0123456789ABCDEF]*
/ C- j, {2 [7 }1 u# LAddress -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']'
6 i( Y& A: l S# `% B" {0 w+ BRegister -> 'A' | 'X' | 'Y' | 'P' 4 H: Q+ `6 [) E' y
Flag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V'
3 x, F% x; O$ d. |; dPC Bank -> 'K' - B' R5 a7 `' J+ y4 b
Data Bank -> 'T' 6 {1 v, P. F8 y& r7 J( S$ t
- \0 B9 u" [0 z
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./ e" `! f7 s) \# b. }0 W5 o9 f
- |( p: Q/ y1 W, S
Registers A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.$ g1 T. d6 j5 V9 _
4 E; i4 ^- K4 D5 D* Q* p
Flags evaluate to 1 if set, 0 if clear./ n5 ^4 O1 S. v6 p k
9 @- k' e1 N9 ^, {: E4 e
Connecting operators || or && combine boolean terms. Parentheses dictate order of operations./ Z% f8 f- T+ g) o- I
) K+ i& {2 \. ]1 c
Example conditions:
2 b+ S( ]9 E6 j- J+ _0 T- N! @+ }* e. z! H
Break only if register A is less than value at memory address $0005:) }0 B0 a6 @' [1 v0 }5 N
% X' m) q9 S9 v* M b5 p$ C
A < $0005" l ^- Z/ R7 ^% Z) Y* e- h
, D, f9 c; J$ W. p% i
Break only if the value at the indirect address is not equal to FF:
) ]8 ~! u3 W- f
" V1 P: Y' A9 ~# u#FF != $[$10+($11*#100)]
5 \+ {, X9 U+ y7 r6 ^
: J6 d; p7 L- {" w; ^; EBreak only if flag N is clear or A is not equal to 00:
9 g: ~4 l3 p( R- K2 B! X2 M. k% S3 m' l( L0 B8 v
(N==#0 || A!=#0)0 a4 O# z7 Z, p7 W# v- c
+ s0 l H0 W: H! |) V" PBreak only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):
% X5 o% N& L) F7 K
8 R7 L+ R) H; Y6 E' C. ST==#2
: c; J7 L- p F! C5 U5 ~. x; O
9 n9 V% f2 ]$ s X' y以上内容来自fceux自带的帮助文档说明 |
|