签到天数: 2134 天 [LV.Master]伴坛终老
|
发表于 2014-1-24 16:59:47
|
显示全部楼层
回3楼:其他条件断点 g# {$ }/ f& {- O& R; n
Conditional Breakpoints8 G# e. |: l: w! P3 s" d: Q, J- I3 X
# A: A8 a5 q+ I% X+ `* }; e' KBreakpoints 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:
+ F9 Y" M, p j2 u/ b: ]
+ j5 K& E3 y% ~" r; NConnect -> Compare { ('||' | '&&') Compare } . t$ I/ R5 O9 R6 ?# `' J, ]
Compare -> Sum { ('==' | '!=' | '<=' | '>=' | '<' | '>') Sum }
8 D( l$ u! l, Q: I$ g5 FSum -> Product { ('+' | '-') Product }
- X4 J9 P3 p4 J; M7 m# D3 s2 d3 kProduct -> Primitive { ('*' | '/') Primitive } 8 C( j8 [# @. P% T2 `+ R
Primitive -> Number | Address | Register | Flag | PC Bank | Data Bank | '(' Connect ')' G5 \% e3 N T1 I' S1 C
Number -> '#' [0123456789ABCDEF]* # \, F9 p$ ?5 F
Address -> '$' [0123456789ABCDEF]* | '$' '[' Connect ']' ) |6 m+ X+ u) i! _; f3 N
Register -> 'A' | 'X' | 'Y' | 'P'
! P( v! Z+ g3 ~1 a7 a2 _% iFlag -> 'N' | 'C' | 'Z' | 'I' | 'B' | 'V' . F+ }- {9 f R* [
PC Bank -> 'K' / L2 l/ v. I" p$ r8 \: N% S8 n
Data Bank -> 'T' 1 N' _ _4 n, t# w; m, X: t
3 x# C9 c v+ c% O
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.1 F4 m3 g* x5 n% T0 T1 i3 [
* g6 Q; F. v% @7 V1 a" nRegisters A/X/Y are 8-bit unsigned values. Register P is the 16-bit program counter.+ t e1 l! i) J5 b2 ?
) n3 s W# \# J6 |Flags evaluate to 1 if set, 0 if clear.% C% b3 _ U$ c& d3 o8 Z
5 s- j* I+ J# s3 qConnecting operators || or && combine boolean terms. Parentheses dictate order of operations.& ~7 [+ n- Q8 D2 Q+ q
% x# M& F1 `1 e1 d& DExample conditions:& t( h9 y" u/ X1 O' o& |
& r, G6 j6 p( c: ]3 y# w' eBreak only if register A is less than value at memory address $0005:
* H5 |8 {6 Z1 \8 X! G
- A" h# r: t1 W9 O' hA < $0005
& c$ D) @# {# T! W& _+ Q$ x4 Q0 T1 k; `- h
Break only if the value at the indirect address is not equal to FF:
& e! N. G; H6 Y( D( d$ e, Z1 Q8 L* u6 c- ^, V4 L! Q
#FF != $[$10+($11*#100)]
6 X! Q% o* o) f u$ R5 Q/ G* {& `! e8 Y, p4 n
Break only if flag N is clear or A is not equal to 00:' B+ u8 w Q! o' _- A. {
+ P4 `) S, ?; x1 s1 {6 D
(N==#0 || A!=#0)3 h: i) P. O# J9 J" y8 c
' E L/ V7 R; r6 i x; iBreak only when accessing a data from bank 2 (the condiition is relevant when using with Read/Write-type breakpoints):
1 ^$ s7 W; g6 e) a f
; q! a$ e: k$ e5 ZT==#2 ) n. s! q' L$ J( j3 l- Y" n: E
8 ^, v M. W2 c" S" }6 l以上内容来自fceux自带的帮助文档说明 |
|