-
Notifications
You must be signed in to change notification settings - Fork 0
/
plans
70 lines (66 loc) · 3.47 KB
/
plans
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Spiffy: Yet another ZX Spectrum emulator
Ideas & Future Plans
CORE:
DEBUGGER:
Disabled & single-shot breakpoints.
Funky breakpoints in debugger: break on memory read/write in range, port read/write in range (or matching bits), execution of RET, RETurn from current function (effectively just single-shot (SP) read trap).
Breakpoint conditions, like Tstate count, register-has-value, memory-location-has-value. Allow conditions to be ANDed together (eg. Break on port read !A0 while Tstate between foo and bar and regB nonzero).
Arguments to t[race] interpreted like p, with the semantics of gdb 'display'.
Command to refresh (ie. SDL_Flip()) the screen.
Macros.
Attaching macros (and single commands?) to breakpoints (on this breakpoint, run that macro).
Search for JP/CALL/JR to an address.
Search for literal NN in LD.
Search for [NN] in LD.
UI:
Debugger frontend harness: user-friendly debugger frontends (curses? GUI?)
DPRINT:
Stuff still todo: autocast in =, shifts/rotates
Stuff still to document: casting rules, common {integer, numeric} type rules
Examples:
.b 8ccc - byte at 0x8ccc.
.f dead - 5-byte float at 0xdead.
.w @VARS - word at VARS.
.8 + .w @CHARS 118 - 8 bytes from 280 bytes after the address pointed to by CHARS (0x5c36).
.b + #IX 25 - byte at IX+0x25.
= .b #DE .b #HL - copies a byte from [HL] to [DE], and prints the byte copied.
.b:AY 5 - byte from AY register 5. (However, the 'a' (and 'u') commands will be kept as they perform decoding of these values).
>> #A 1 - value of A, shifted right once (logical shift, not arithmetic shift)
<<< #A 3 - value of A, rotated left three times
Syntax:
<expression> ::= <unop> <expression> | <binop> <expression> <expression> | <sysvar> | <register> | <literal>
<unop> ::= '~' | <indirection> | <cast>
<binop> ::= '+' | '-' | '*' | '/' | '%' | '&' | '|' | '^' | '<<' | '>>' | '<<<' | '>>>' | '<<|' | '>>|' | '='
<cast> ::= '\'' <type>
<indirection>::= '.'<type> | '.'<type>':'<far>
<type> ::= 'b' | 'w' | 'f' | '8' | 'R'
<far> ::= 'AY' | 'ULAPLUS'
<sysvar> ::= '@'<sysvarname>
<register> ::= '#'<registername>
<literal> ::= <hex-literal> | <float-lit>
<hex-literal>::= <xdigit>*{1,4}
<float-lit> ::= '_'<float-val>
Semantics:
op types description & return type
~ bw8R Bitwise Complement. Return has type of operand.
+ numeric Sum. Common numeric type rules apply.
- As + Difference. Return type as +.
* As + Product. Return type as +.
/ As + Quotient. Return type as +.
% integer Remainder. Common integer type rules apply.
& As % Bitwise AND. Return type as %.
| As % Bitwise OR. Return type as %.
^ As % Bitwise XOR. Return type as %.
<< (bw)b Left shift. Return has type of first operand.
>> As << Right shift. Return type as <<.
<<< As << Left rotate. Return type as <<.
>>> As << Right rotate. Return type as <<.
<<| As << Left shift set (ie. left shift, then set the lsb). Return type as <<.
>>| As << Right shift arithmetic. Return type as <<.
= lvalue Assignment. First operand must be an lvalue. Second operand must be castable to type of first operand. Returns first operand.
'T T-castable Typecast. Return type given by T.
.T bw Indirection. Return type given by T, and is an lvalue.
@ Return type is w, and is the address of the sysvar.
# Return type is b for 8-bit registers, w for 16-bit.
hex-literal Return type is b if <=2 xdigits, else w.
_float-lit Return type is f.