-
Notifications
You must be signed in to change notification settings - Fork 0
/
helper_notes
42 lines (33 loc) · 1.13 KB
/
helper_notes
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
"Z80 Instruction Information" flags:
C Z P/V S N H
Decoding-bits:
xxppqzzz
Registers (Spiffy offsets):
PCAFBCDEHLIxIyiRSPafbcdehl
1032547698badcfe1032547698
PC = Program Counter
A = Accumulator
F = Flags register [7]SZ5H3PNC[0]
BC, DE, HL: user registers
Ix, Iy: Index registers
i: Interrupt Vector
R: Memory Refresh
SP: Stack Pointer
afbcdehl: Alternate register set (EX/EXX)
tbl_r: B C D E H L (HL) A
tbl_rp: BC DE HL SP
tbl_rp2: BC DE HL AF
Shiftstate bits: 1=CB 2=ED 4=DD 8=FD
'cc' conditions:
[0]NZ Z NC C PO PE P M[7]
block instructions:
y: 4=I 5=D 6=IR 7=DR == b0: DEC (else INC); b1: REPEAT
z: 0=LD 1=CP 2=IN 3=OUT
LDxx: LD (DE),(HL); DE+-; HL+-; BC--; R? BC? PC-=2.
CPxx: CP A,(HL); HL+-; BC--; R? BC&&(A!=old(HL))? PC-=2.
INxx: IN (HL), port(BC); HL+-; B--; R? B? PC-=2.
OTxx: B--; OUT port(BC),(HL); HL+-; R? B? PC-=2.
IM:
The undoc IM 0/1 (ED 4E and others) sets IM 0 (The Undocumented Z80 Documented)
Register starting values: http://www.worldofspectrum.org/forums/showthread.php?t=34574
Timing reference for 128k: http://www.worldofspectrum.org/faq/reference/128kreference.htm (may be somewhat bogus)