annotate notes.txt @ 546:90aca661542b

Make references to flags in the M68K core respect the flag_regs options array so that flags can be moved out of registers for the 32-bit port. set/get ccr/sr still need to be updated to support this, but everything else should be done.
author Michael Pavone <pavone@retrodev.com>
date Mon, 17 Feb 2014 19:58:37 -0800
parents 0ae589d4c3f9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
1 cmp.w <ea>, Dn 4(1/0) + <ea> time
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
2 cmp.l <ea>, Dn 6(1/0) + <ea> time
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
3 cmp.w #num, Dn 4(1/0) + 4(1/0)
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
4 cmp.l #num, Dn 6(1/0) + 8(2/0)
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
5
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
6 cmpi.w #num, Dn 8(2/0)
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
7 cmpi.l #num, Dn 14(3/0)
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
8
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
9
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
10 movem
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
11
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
12 subtype field (bits 9-11) = 110 or 100 depending on direction
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
13 bit 8 = 0
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
14 bit 7 = 1
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
15 bit 6 = size
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
16
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
17
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
18
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
19 x86-64 registers in 68K core
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
20
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
21 1. native stack pointer
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
22 2. current cycle count
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
23 3. target cycle count
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
24 4. cartridge address
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
25 5. work ram address
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
26 6. scratch register
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
27 7. context pointer (contains 68K registers and memory pointers not in registers)
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
28 8. status register (maybe, depends on how well I can abuse native x86 status stuff)
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
29 Rest of registers used for holding 68K registers
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
30
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
31 rax = cycle counter
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
32 bl = N flag
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
33 bh = V flag
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
34 rcx = scratch register
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
35 dl = Z flag
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
36 dh = C flag
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
37 rbp = target cycle count
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
38 rsi = context pointer
18
3e7bfde7606e M68K to x86 translation works for a limited subset of instructions and addressing modes
Mike Pavone <pavone@retrodev.com>
parents: 14
diff changeset
39 rdi = scratch register
3e7bfde7606e M68K to x86 translation works for a limited subset of instructions and addressing modes
Mike Pavone <pavone@retrodev.com>
parents: 14
diff changeset
40 r8 = cartridge address
3e7bfde7606e M68K to x86 translation works for a limited subset of instructions and addressing modes
Mike Pavone <pavone@retrodev.com>
parents: 14
diff changeset
41 r9 = work ram address
3e7bfde7606e M68K to x86 translation works for a limited subset of instructions and addressing modes
Mike Pavone <pavone@retrodev.com>
parents: 14
diff changeset
42 r10 = d0
3e7bfde7606e M68K to x86 translation works for a limited subset of instructions and addressing modes
Mike Pavone <pavone@retrodev.com>
parents: 14
diff changeset
43 r11 = d1
3e7bfde7606e M68K to x86 translation works for a limited subset of instructions and addressing modes
Mike Pavone <pavone@retrodev.com>
parents: 14
diff changeset
44 r12 = d2
3e7bfde7606e M68K to x86 translation works for a limited subset of instructions and addressing modes
Mike Pavone <pavone@retrodev.com>
parents: 14
diff changeset
45 r13 = a0
3e7bfde7606e M68K to x86 translation works for a limited subset of instructions and addressing modes
Mike Pavone <pavone@retrodev.com>
parents: 14
diff changeset
46 r14 = a1
3e7bfde7606e M68K to x86 translation works for a limited subset of instructions and addressing modes
Mike Pavone <pavone@retrodev.com>
parents: 14
diff changeset
47 r15 = a7
14
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
48 rsp = native stack pointer
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
49
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
50 68K context:
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
51 uint8_t flags[5];
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
52 uint8_t pad??[3]
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
53 uint32_t dregs[8]; //8 + 4 * reg
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
54 uint32_t aregs[8]; //40 + 4 * reg
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
55 .....
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
56
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
57 x86-64 registers in Z80 core
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
58
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
59 ax = HL
14
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
60 bx = BC
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
61 cx = DE
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
62 dx = IX
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
63 ebp = current cycle count
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
64 rsi = context pointer
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
65 edi = target cycle count
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
66 rsp = native stack pointer
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
67 r8 = IY
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
68 r9 = SP
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
69 r10 = A (maybe AF?)
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
70 r11 = z80 ram address
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
71 r12 = cartridge address if bank is pointed at ROM
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
72 r13 = scratch1
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
73 r14 = scratch2
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
74 r15 = ?maybe z80 bank register?
14
2bdad0f52f42 x86 code gen, initial work on translator
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
75
203
0ae589d4c3f9 Add support for 2-byte IX instructions to decoder
Mike Pavone <pavone@retrodev.com>
parents: 18
diff changeset
76