Mercurial > repos > blastem
annotate m68k.cpu @ 2450:6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 18 Feb 2024 22:34:51 -0800 |
parents | d1eec03dca09 |
children | 7d7525769ce2 |
rev | line source |
---|---|
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 info |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 prefix m68k_ |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 opcode_size 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 body m68k_run_op |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 header m68k.h |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 interrupt m68k_interrupt |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 include m68k_util.c |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 sync_cycle m68k_sync_cycle |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 declare |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
11 typedef m68k_context *(*sync_fun)(m68k_context * context, uint32_t address); |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
12 typedef m68k_context *(*int_ack_fun)(m68k_context * context); |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 typedef m68k_context *(*m68k_reset_handler)(m68k_context *context); |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
14 void init_m68k_opts(m68k_options *opts, memmap_chunk * memmap, uint32_t num_chunks, uint32_t clock_divider, sync_fun sync_components, int_ack_fun int_ack); |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 m68k_context *init_68k_context(m68k_options * opts, m68k_reset_handler reset_handler); |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 void m68k_reset(m68k_context *context); |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 void m68k_print_regs(m68k_context *context); |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 regs |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 dregs 32 d0 d1 d2 d3 d4 d5 d6 d7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 aregs 32 a0 a1 a2 a3 a4 a5 a6 a7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 pc 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 other_sp 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 scratch1 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
25 scratch2 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
26 int_cycle 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
27 prefetch 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
28 int_priority 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
29 int_num 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
30 int_pending 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
31 int_pending_num 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
32 int_ack 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
33 status 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
34 ccr 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
35 xflag 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
36 nflag 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
37 zflag 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
38 vflag 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
39 cflag 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
40 reset_handler ptrvoid |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
41 mem_pointers ptrvoid 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
42 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
43 flags |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
44 register ccr |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
45 X 4 carry xflag |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
46 N 3 sign nflag |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
47 Z 2 zero zflag |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
48 V 1 overflow vflag |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
49 C 0 carry cflag |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
50 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
51 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
52 if dynarec |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
53 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
54 ccall m68k_read16_noinc context pc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
55 mov result prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
56 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
57 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
58 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
59 if interp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
60 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
61 mov pc scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
62 ocall read_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
63 mov scratch1 prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
64 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
65 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
66 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
67 add 2 pc pc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
68 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
69 check_user_mode_swap_ssp_usp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
70 local tmp 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
71 and 0x20 status tmp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
72 if tmp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
73 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
74 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
75 xchg other_sp a7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
76 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
77 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
78 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
79 m68k_get_sr |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
80 lsl status 8 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
81 or ccr scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
82 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
83 m68k_write32_lowfirst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
84 arg value 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
85 add 2 scratch2 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
86 mov value scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
87 ocall write_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
88 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
89 sub 2 scratch2 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
90 lsr value 16 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
91 ocall write_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
92 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
93 m68k_write32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
94 arg value 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
95 local tmp 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
96 mov value tmp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
97 lsr value 16 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
98 ocall write_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
99 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
100 add 2 scratch2 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
101 mov tmp scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
102 ocall write_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
103 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
104 m68k_read32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
105 local tmp 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
106 add 2 scratch1 tmp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
107 ocall read_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
108 xchg scratch1 tmp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
109 ocall read_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
110 lsl tmp 16 tmp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
111 or tmp scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
112 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
113 m68k_interrupt |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
114 cmp int_cycle cycles |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
115 if >=U |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
116 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
117 #INT_PENDING_NONE |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
118 cmp 255 int_pending |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
119 if = |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
120 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
121 mov int_priority int_pending |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
122 mov int_num int_pending_num |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
123 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
124 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
125 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
126 #INT_PENDING_SR_CHANGE |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
127 cmp 254 int_pending |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
128 if = |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
129 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
130 mov int_priority int_pending |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
131 mov int_num int_pending_num |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
132 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
133 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
134 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
135 check_user_mode_swap_ssp_usp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
136 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
137 cycles 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
138 #save status reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
139 sub 6 a7 a7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
140 m68k_get_sr |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
141 mov a7 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
142 ocall write_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
143 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
144 #update status register |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
145 and 0x78 status status |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
146 or int_priority status status |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
147 or 0x20 status status |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
148 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
149 #Interrupt ack cycle |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
150 mov int_pending int_ack |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
151 if int_pending_num |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
152 cycles 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
153 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
154 #TODO: do the whole E clock variable latency nonsense |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
155 cycles 13 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
156 add 24 int_pending int_pending_num |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
157 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
158 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
159 #save pc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
160 add 2 a7 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
161 m68k_write32_lowfirst pc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
162 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
163 lsl int_pending_num 2 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
164 m68k_read32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
165 mov scratch1 pc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
166 update_sync |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
167 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
168 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
169 m68k_run_op |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
170 dispatch prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
171 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
172 m68k_mem_src |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
173 arg address 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
174 arg size 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
175 arg isdst 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
176 mov address scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
177 if isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
178 mov address scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
179 meta ismem 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
180 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
181 switch size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
182 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
183 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
184 ocall read_8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
185 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
186 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
187 ocall read_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
188 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
189 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
190 m68k_read32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
191 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
192 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
193 meta op scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
194 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
195 m68k_write_size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
196 arg size 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
197 arg lowfirst 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
198 switch size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
199 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
200 ocall write_8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
201 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
202 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
203 ocall write_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
204 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
205 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
206 if lowfirst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
207 m68k_write32_lowfirst scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
208 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
209 m68k_write32 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
210 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
211 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
212 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
213 m68k_index_word |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
214 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
215 local disp 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
216 and prefetch 255 disp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
217 sext 16 disp disp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
218 sext 32 disp disp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
219 local index 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
220 lsr prefetch 12 index |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
221 local isareg 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
222 and index 8 isareg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
223 and index 7 index |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
224 local islong 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
225 and prefetch 2048 islong |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
226 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
227 switch isareg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
228 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
229 switch islong |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
230 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
231 sext 32 dregs.index scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
232 case 2048 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
233 mov dregs.index scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
234 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
235 case 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
236 switch islong |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
237 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
238 sext 32 aregs.index scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
239 case 2048 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
240 mov aregs.index scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
241 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
242 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
243 add disp scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
244 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
245 m68k_fetch_op_ea |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
246 arg mode 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
247 arg reg 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
248 arg Z 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
249 arg isdst 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
250 switch mode |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
251 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
252 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
253 #data reg direct |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
254 meta op dregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
255 if isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
256 meta ismem 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
257 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
258 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
259 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
260 #address reg direct |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
261 meta op aregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
262 if isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
263 meta ismem 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
264 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
265 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
266 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
267 #address reg indirect |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
268 m68k_mem_src aregs.reg Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
269 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
270 case 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
271 #postincrement |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
272 m68k_mem_src aregs.reg Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
273 switch reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
274 case 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
275 if Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
276 addsize Z aregs.reg aregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
277 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
278 addsize 1 aregs.reg aregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
279 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
280 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
281 addsize Z aregs.reg aregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
282 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
283 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
284 case 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
285 #predecrement |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
286 switch reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
287 case 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
288 if Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
289 decsize Z aregs.reg aregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
290 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
291 decsize 1 aregs.reg aregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
292 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
293 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
294 decsize Z aregs.reg aregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
295 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
296 cycles 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
297 m68k_mem_src aregs.reg Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
298 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
299 case 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
300 #displacement |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
301 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
302 sext 32 prefetch scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
303 add scratch1 aregs.reg scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
304 m68k_mem_src scratch1 Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
305 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
306 case 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
307 #indexed |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
308 m68k_index_word |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
309 cycles 2 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
310 add aregs.reg scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
311 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
312 m68k_mem_src scratch1 Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
313 case 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
314 #pc-relative and absolute modes |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
315 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
316 switch reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
317 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
318 #absolute short |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
319 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
320 sext 32 prefetch scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
321 m68k_mem_src scratch1 Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
322 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
323 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
324 #absolute long |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
325 local address 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
326 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
327 lsl prefetch 16 address |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
328 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
329 or prefetch address scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
330 m68k_mem_src scratch1 Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
331 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
332 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
333 #pc displaceent |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
334 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
335 sext 32 prefetch scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
336 add scratch1 pc scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
337 sub 2 scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
338 m68k_mem_src scratch1 Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
339 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
340 case 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
341 #pc indexed |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
342 m68k_index_word |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
343 cycles 2 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
344 add pc scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
345 sub 2 scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
346 m68k_mem_src scratch1 Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
347 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
348 case 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
349 #immediate |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
350 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
351 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
352 local tmp32 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
353 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
354 lsl prefetch 16 tmp32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
355 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
356 or prefetch tmp32 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
357 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
358 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
359 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
360 mov prefetch scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
361 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
362 meta op scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
363 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
364 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
365 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
366 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
367 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
368 m68k_fetch_src_ea |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
369 arg mode 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
370 arg reg 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
371 arg Z 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
372 m68k_fetch_op_ea mode reg Z 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
373 meta src op |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
374 switch mode |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
375 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
376 meta src_is_mem 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
377 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
378 meta src_is_mem 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
379 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
380 meta src_is_mem 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
381 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
382 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
383 m68k_fetch_dst_ea |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
384 arg mode 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
385 arg reg 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
386 arg Z 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
387 m68k_fetch_op_ea mode reg Z 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
388 meta dst op |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
389 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
390 m68k_save_dst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
391 arg Z 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
392 if ismem |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
393 m68k_write_size Z 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
394 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
395 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
396 1101DDD0ZZMMMRRR add_ea_dn |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
397 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
398 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
399 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
400 invalid Z 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
401 m68k_fetch_src_ea M R Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
402 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
403 add src dregs.D dregs.D Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
404 update_flags XNZVC |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
405 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
406 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
407 1101DDD1ZZMMMRRR add_dn_ea |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
408 invalid M 0 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
409 invalid M 1 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
410 invalid M 7 R 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
411 invalid M 7 R 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
412 invalid M 7 R 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
413 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
414 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
415 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
416 invalid Z 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
417 m68k_fetch_dst_ea M R Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
418 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
419 add dregs.D dst dst Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
420 update_flags XNZVC |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
421 m68k_save_dst Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
422 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
423 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
424 1101AAAZ11MMMRRR adda |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
425 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
426 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
427 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
428 local size 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
429 local ext_src 32 |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
430 #TODO: ensure "penalty" cycles are in the right place |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
431 if Z |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
432 size = 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
433 switch M |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
434 case 0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
435 #dreg src |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
436 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
437 case 1 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
438 #areg src |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
439 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
440 case 7 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
441 if R = 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
442 #immediate |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
443 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
444 else |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
445 cycles 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
446 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
447 default |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
448 cycles 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
449 end |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
450 else |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
451 size = 1 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
452 cycles 4 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
453 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
454 m68k_fetch_src_ea M R size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
455 switch size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
456 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
457 sext 32 src ext_src |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
458 meta src ext_src |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
459 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
460 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
461 add src aregs.A aregs.A |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
462 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
463 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
464 00000110ZZMMMRRR addi |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
465 local immed 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
466 invalid Z 3 |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
467 invalid M 1 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
468 invalid M 7 R 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
469 invalid M 7 R 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
470 invalid M 7 R 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
471 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
472 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
473 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
474 #fetch immediate operand |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
475 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
476 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
477 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
478 lsl prefetch 16 immed |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
479 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
480 or prefetch immed immed |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
481 if M = 0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
482 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
483 end |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
484 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
485 mov prefetch immed |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
486 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
487 #fetch dst EA |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
488 m68k_fetch_dst_ea M R Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
489 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
490 add immed dst dst Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
491 update_flags XNZVC |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
492 m68k_save_dst Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
493 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
494 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
495 0101III0ZZMMMRRR addq |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
496 invalid Z 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
497 invalid M 7 R 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
498 invalid M 7 R 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
499 invalid M 7 R 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
500 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
501 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
502 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
503 local src 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
504 switch I |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
505 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
506 mov 8 src |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
507 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
508 mov I src |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
509 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
510 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
511 m68k_fetch_dst_ea M R Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
512 switch M |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
513 case 1 |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
514 cycles 4 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
515 add src dst dst Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
516 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
517 add src dst dst Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
518 update_flags XNZVC |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
519 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
520 m68k_save_dst Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
521 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
522 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
523 1101DDD1ZZ000SSS addx_dy_dx |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
524 invalid Z 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
525 adc dregs.S dregs.D dregs.D Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
526 update_flags XNVC |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
527 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
528 case 0 |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
529 local tmp8 8 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
530 mov dregs.D tmp8 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
531 if tmp8 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
532 update_flags Z0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
533 end |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
534 case 1 |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
535 local tmp16 16 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
536 mov dregs.D tmp16 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
537 if tmp16 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
538 update_flags Z0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
539 end |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
540 case 2 |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
541 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
542 if dregs.D |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
543 update_flags Z0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
544 end |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
545 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
546 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
547 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
548 1101DDD1ZZ001SSS addx_ay_ax |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
549 invalid Z 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
550 if Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
551 decsize Z aregs.S aregs.S |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
552 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
553 switch S |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
554 case 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
555 sub 2 aregs.S aregs.S |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
556 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
557 decsize Z aregs.S aregs.S |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
558 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
559 end |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
560 #predec penalty on src only |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
561 cycles 2 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
562 mov aregs.S scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
563 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
564 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
565 ocall read_8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
566 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
567 ocall read_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
568 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
569 m68k_read32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
570 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
571 mov scratch1 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
572 if Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
573 decsize Z aregs.D aregs.D |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
574 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
575 switch D |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
576 case 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
577 sub 2 aregs.D aregs.D |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
578 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
579 decsize Z aregs.D aregs.D |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
580 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
581 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
582 mov aregs.D scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
583 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
584 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
585 ocall read_8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
586 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
587 ocall read_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
588 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
589 m68k_read32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
590 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
591 adc scratch2 scratch1 scratch1 Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
592 update_flags XNVC |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
593 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
594 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
595 local tmp8 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
596 mov dregs.D tmp8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
597 if tmp8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
598 update_flags Z0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
599 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
600 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
601 local tmp16 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
602 mov dregs.D tmp16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
603 if tmp16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
604 update_flags Z0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
605 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
606 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
607 if dregs.D |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
608 update_flags Z0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
609 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
610 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
611 mov aregs.D scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
612 m68k_write_size Z 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
613 m68k_prefetch |
1939
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
614 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
615 1100DDD0ZZMMMRRR and_ea_dn |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
616 invalid M 1 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
617 invalid M 7 R 5 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
618 invalid M 7 R 6 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
619 invalid M 7 R 7 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
620 invalid Z 3 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
621 m68k_fetch_src_ea M R Z |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
622 |
1939
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
623 and src dregs.D dregs.D Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
624 update_flags NZV0C0 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
625 m68k_prefetch |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
626 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
627 1100DDD1ZZMMMRRR and_dn_ea |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
628 invalid M 0 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
629 invalid M 1 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
630 invalid M 7 R 2 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
631 invalid M 7 R 3 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
632 invalid M 7 R 4 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
633 invalid M 7 R 5 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
634 invalid M 7 R 6 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
635 invalid M 7 R 7 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
636 invalid Z 3 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
637 m68k_fetch_dst_ea M R Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
638 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
639 and dregs.D dst dst Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
640 update_flags NZV0C0 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
641 m68k_save_dst Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
642 m68k_prefetch |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
643 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
644 00000010ZZMMMRRR andi |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
645 local immed 32 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
646 invalid Z 3 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
647 invalid M 1 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
648 invalid M 7 R 2 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
649 invalid M 7 R 3 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
650 invalid M 7 R 4 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
651 invalid M 7 R 5 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
652 invalid M 7 R 6 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
653 invalid M 7 R 7 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
654 #fetch immediate operand |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
655 m68k_prefetch |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
656 switch Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
657 case 2 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
658 lsl prefetch 16 immed |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
659 m68k_prefetch |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
660 or prefetch immed immed |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
661 if M = 0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
662 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
663 end |
1939
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
664 default |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
665 mov prefetch immed |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
666 end |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
667 #fetch dst EA |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
668 m68k_fetch_dst_ea M R Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
669 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
670 and immed dst dst Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
671 update_flags NZV0C0 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
672 m68k_save_dst Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
673 m68k_prefetch |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
674 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
675 0000001000111100 andi_to_ccr |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
676 #fetch immediate operand |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
677 m68k_prefetch |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
678 and prefetch ccr ccr |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
679 m68k_prefetch |
1940
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
680 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
681 1011DDD1ZZMMMRRR eor_dn_ea |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
682 invalid M 1 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
683 invalid M 7 R 2 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
684 invalid M 7 R 3 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
685 invalid M 7 R 4 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
686 invalid M 7 R 5 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
687 invalid M 7 R 6 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
688 invalid M 7 R 7 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
689 invalid Z 3 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
690 m68k_fetch_dst_ea M R Z |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
691 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
692 if Z = 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
693 if M = 0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
694 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
695 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
696 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
697 |
1940
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
698 xor dregs.D dst dst Z |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
699 update_flags NZV0C0 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
700 m68k_save_dst Z |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
701 m68k_prefetch |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
702 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
703 00001010ZZMMMRRR eori |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
704 local immed 32 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
705 invalid Z 3 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
706 invalid M 1 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
707 invalid M 7 R 2 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
708 invalid M 7 R 3 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
709 invalid M 7 R 4 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
710 invalid M 7 R 5 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
711 invalid M 7 R 6 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
712 invalid M 7 R 7 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
713 #fetch immediate operand |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
714 m68k_prefetch |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
715 switch Z |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
716 case 2 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
717 lsl prefetch 16 immed |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
718 m68k_prefetch |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
719 or prefetch immed immed |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
720 if M = 0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
721 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
722 end |
1940
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
723 default |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
724 mov prefetch immed |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
725 end |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
726 #fetch dst EA |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
727 m68k_fetch_dst_ea M R Z |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
728 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
729 xor immed dst dst Z |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
730 update_flags NZV0C0 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
731 m68k_save_dst Z |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
732 m68k_prefetch |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
733 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
734 0000001000111100 eori_to_ccr |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
735 #fetch immediate operand |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
736 m68k_prefetch |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
737 xor prefetch ccr ccr |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
738 m68k_prefetch |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
739 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
740 1000DDD0ZZMMMRRR or_ea_dn |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
741 invalid M 1 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
742 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
743 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
744 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
745 invalid Z 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
746 m68k_fetch_src_ea M R Z |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
747 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
748 if Z = 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
749 switch M |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
750 case 0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
751 #dreg |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
752 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
753 case 7 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
754 if R = 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
755 #immediate |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
756 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
757 else |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
758 cycles 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
759 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
760 default |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
761 cycles 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
762 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
763 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
764 |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
765 or src dregs.D dregs.D Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
766 update_flags NZV0C0 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
767 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
768 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
769 1000DDD1ZZMMMRRR or_dn_ea |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
770 invalid M 0 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
771 invalid M 1 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
772 invalid M 7 R 2 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
773 invalid M 7 R 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
774 invalid M 7 R 4 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
775 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
776 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
777 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
778 invalid Z 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
779 m68k_fetch_dst_ea M R Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
780 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
781 or dregs.D dst dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
782 update_flags NZV0C0 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
783 m68k_save_dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
784 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
785 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
786 00000000ZZMMMRRR ori |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
787 local immed 32 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
788 invalid Z 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
789 invalid M 1 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
790 invalid M 7 R 2 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
791 invalid M 7 R 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
792 invalid M 7 R 4 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
793 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
794 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
795 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
796 #fetch immediate operand |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
797 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
798 switch Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
799 case 2 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
800 lsl prefetch 16 immed |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
801 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
802 or prefetch immed immed |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
803 if M = 0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
804 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
805 end |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
806 default |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
807 mov prefetch immed |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
808 end |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
809 #fetch dst EA |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
810 m68k_fetch_dst_ea M R Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
811 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
812 or immed dst dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
813 update_flags NZV0C0 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
814 m68k_save_dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
815 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
816 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
817 0000000000111100 ori_to_ccr |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
818 #fetch immediate operand |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
819 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
820 or prefetch ccr ccr |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
821 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
822 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
823 1001DDD0ZZMMMRRR sub_ea_dn |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
824 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
825 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
826 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
827 invalid Z 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
828 m68k_fetch_src_ea M R Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
829 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
830 sub src dregs.D dregs.D Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
831 update_flags XNZVC |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
832 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
833 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
834 1001DDD1ZZMMMRRR sub_dn_ea |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
835 invalid M 0 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
836 invalid M 1 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
837 invalid M 7 R 2 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
838 invalid M 7 R 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
839 invalid M 7 R 4 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
840 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
841 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
842 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
843 invalid Z 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
844 m68k_fetch_dst_ea M R Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
845 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
846 sub dregs.D dst dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
847 update_flags XNZVC |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
848 m68k_save_dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
849 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
850 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
851 1001AAAZ11MMMRRR suba |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
852 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
853 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
854 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
855 local size 16 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
856 local ext_src 32 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
857 if Z |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
858 size = 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
859 switch M |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
860 case 0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
861 #dreg src |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
862 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
863 case 1 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
864 #areg src |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
865 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
866 case 7 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
867 if R = 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
868 #immediate |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
869 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
870 else |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
871 cycles 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
872 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
873 default |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
874 cycles 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
875 end |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
876 else |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
877 size = 1 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
878 cycles 4 |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
879 end |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
880 m68k_fetch_src_ea M R size |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
881 switch size |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
882 case 1 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
883 sext 32 src ext_src |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
884 meta src ext_src |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
885 end |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
886 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
887 sub src aregs.A aregs.A |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
888 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
889 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
890 00000100ZZMMMRRR subi |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
891 local immed 32 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
892 invalid Z 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
893 invalid M 1 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
894 invalid M 7 R 2 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
895 invalid M 7 R 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
896 invalid M 7 R 4 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
897 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
898 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
899 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
900 #fetch immediate operand |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
901 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
902 switch Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
903 case 2 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
904 lsl prefetch 16 immed |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
905 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
906 or prefetch immed immed |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
907 if M = 0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
908 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
909 end |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
910 default |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
911 mov prefetch immed |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
912 end |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
913 #fetch dst EA |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
914 m68k_fetch_dst_ea M R Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
915 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
916 sub immed dst dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
917 update_flags XNZVC |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
918 m68k_save_dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
919 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
920 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
921 0101III1ZZMMMRRR subq |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
922 invalid Z 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
923 invalid M 7 R 2 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
924 invalid M 7 R 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
925 invalid M 7 R 4 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
926 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
927 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
928 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
929 local src 32 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
930 switch I |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
931 case 0 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
932 mov 8 src |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
933 default |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
934 mov I src |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
935 end |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
936 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
937 m68k_fetch_dst_ea M R Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
938 switch M |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
939 case 1 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
940 sub src dst dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
941 default |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
942 sub src dst dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
943 update_flags XNZVC |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
944 end |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
945 m68k_save_dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
946 m68k_prefetch |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
947 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
948 1110CCC0ZZ001RRR lsri |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
949 invalid Z 3 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
950 switch C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
951 case 0 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
952 meta shift 8 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
953 default |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
954 meta shift C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
955 end |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
956 lsr dregs.R shift dregs.R Z |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
957 update_flags XNZV0C |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
958 local cyc 32 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
959 cyc = shift + shift |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
960 switch Z |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
961 case 2 |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
962 cyc += 4 |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
963 default |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
964 cyc += 2 |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
965 end |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
966 cycles cyc |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
967 #TODO: should this happen before or after the majority of the shift? |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
968 m68k_prefetch |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
969 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
970 1110CCC0ZZ101RRR lsr_dn |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
971 invalid Z 3 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
972 local shift 8 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
973 and dregs.C 63 shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
974 lsr dregs.R shift dregs.R Z |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
975 update_flags XNZV0C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
976 add shift shift shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
977 switch Z |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
978 case 2 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
979 add 4 shift shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
980 default |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
981 add 2 shift shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
982 end |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
983 cycles shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
984 #TODO: should this happen before or after the majority of the shift? |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
985 m68k_prefetch |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
986 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
987 1110001011MMMRRR lsr_ea |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
988 invalid M 0 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
989 invalid M 1 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
990 invalid M 7 R 2 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
991 invalid M 7 R 3 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
992 invalid M 7 R 4 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
993 invalid M 7 R 5 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
994 invalid M 7 R 6 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
995 invalid M 7 R 7 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
996 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
997 m68k_fetch_dst_ea M R 0 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
998 lsr dst 1 dst |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
999 update_flags XNZV0C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1000 m68k_save_dst 0 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1001 m68k_prefetch |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1002 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1003 1110CCC1ZZ001RRR lsli |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1004 invalid Z 3 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1005 switch C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1006 case 0 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1007 meta shift 8 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1008 default |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1009 meta shift C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1010 end |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1011 lsl dregs.R shift dregs.R Z |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1012 update_flags XNZV0C |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1013 local cyc 32 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1014 cyc = shift + shift |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1015 switch Z |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1016 case 2 |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1017 cyc += 4 |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1018 default |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1019 cyc += 2 |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1020 end |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1021 cycles cyc |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1022 #TODO: should this happen before or after the majority of the shift? |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1023 m68k_prefetch |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1024 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1025 1110CCC1ZZ101RRR lsl_dn |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1026 invalid Z 3 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1027 local shift 8 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1028 and dregs.C 63 shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1029 lsl dregs.R shift dregs.R Z |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1030 update_flags XNZV0C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1031 add shift shift shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1032 switch Z |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1033 case 2 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1034 add 4 shift shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1035 default |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1036 add 2 shift shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1037 end |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1038 cycles shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1039 #TODO: should this happen before or after the majority of the shift? |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1040 m68k_prefetch |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1041 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1042 1110001111MMMRRR lsl_ea |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1043 invalid M 0 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1044 invalid M 1 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1045 invalid M 7 R 2 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1046 invalid M 7 R 3 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1047 invalid M 7 R 4 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1048 invalid M 7 R 5 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1049 invalid M 7 R 6 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1050 invalid M 7 R 7 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1051 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1052 m68k_fetch_dst_ea M R 0 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1053 lsl dst 1 dst |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1054 update_flags XNZV0C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1055 m68k_save_dst 0 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1056 m68k_prefetch |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1057 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1058 00ZZRRRMMMEEESSS move |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1059 invalid Z 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1060 invalid M 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1061 invalid M 7 #not actually invalid, but will be handled separately due to DSL limitations |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1062 invalid E 7 S 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1063 invalid E 7 S 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1064 invalid E 7 S 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1065 local size 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1066 local memsrc 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1067 #move uses a different size format than most instructions |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1068 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1069 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1070 mov 0 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1071 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1072 mov 2 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1073 case 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1074 mov 1 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1075 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1076 m68k_fetch_src_ea E S size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1077 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1078 if src_is_mem |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1079 #avoid clobbering src if we need scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1080 mov src memsrc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1081 meta src memsrc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1082 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1083 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1084 cmp 0 src size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1085 update_flags NZV0C0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1086 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1087 switch M |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1088 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1089 mov src dregs.R size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1090 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1091 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1092 mov aregs.R scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1093 mov src scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1094 m68k_write_size size 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1095 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1096 case 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1097 mov aregs.R scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1098 mov src scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1099 switch R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1100 case 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1101 if size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1102 addsize size aregs.R aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1103 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1104 addsize 1 aregs.R aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1105 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1106 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1107 addsize size aregs.R aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1108 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1109 m68k_write_size size 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1110 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1111 case 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1112 mov src scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1113 switch R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1114 case 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1115 if size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1116 decsize size aregs.R aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1117 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1118 decsize 1 aregs.R aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1119 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1120 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1121 decsize size aregs.R aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1122 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1123 mov aregs.R scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1124 m68k_write_size size 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1125 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1126 case 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1127 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1128 sext 32 prefetch scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1129 add aregs.R scratch2 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1130 mov src scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1131 m68k_write_size size 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1132 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1133 case 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1134 m68k_index_word |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1135 add aregs.R scratch1 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1136 mov src scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1137 m68k_write_size size 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1138 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1139 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1140 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1141 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1142 00ZZ00M111EEESSS move_abs |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1143 invalid E 7 S 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1144 invalid E 7 S 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1145 invalid E 7 S 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1146 invalid Z 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1147 local size 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1148 local memsrc 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1149 #move uses a different size format than most instructions |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1150 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1151 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1152 mov 0 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1153 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1154 mov 2 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1155 case 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1156 mov 1 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1157 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1158 m68k_fetch_src_ea E S size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1159 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1160 if src_is_mem |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1161 #avoid clobbering src if we need scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1162 mov src memsrc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1163 meta src memsrc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1164 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1165 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1166 cmp 0 src size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1167 update_flags NZV0C0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1168 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1169 switch M |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1170 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1171 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1172 sext 32 prefetch scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1173 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1174 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1175 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1176 lsl prefetch 16 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1177 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1178 or prefetch scratch2 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1179 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1180 mov src scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1181 m68k_write_size size 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1182 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1183 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1184 00ZZRRR001EEESSS movea |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1185 local size 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1186 invalid Z 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1187 invalid Z 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1188 invalid E 7 S 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1189 invalid E 7 S 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1190 invalid E 7 S 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1191 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1192 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1193 mov 2 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1194 case 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1195 mov 1 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1196 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1197 m68k_fetch_src_ea E S size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1198 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1199 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1200 mov src aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1201 case 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1202 sext 32 src aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1203 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1204 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1205 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1206 0100010011MMMRRR move_to_ccr |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1207 invalid M 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1208 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1209 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1210 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1211 m68k_fetch_src_ea M R 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1212 mov scratch1 ccr |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1213 cycles 8 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1214 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1215 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1216 0100011011MMMRRR move_to_sr |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1217 invalid M 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1218 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1219 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1220 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1221 m68k_fetch_src_ea M R 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1222 mov scratch1 ccr |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1223 lsr scratch1 8 status |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1224 update_sync |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1225 cycles 8 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1226 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1227 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1228 0100000011MMMRRR move_from_sr |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1229 invalid M 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1230 invalid M 7 R 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1231 invalid M 7 R 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1232 invalid M 7 R 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1233 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1234 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1235 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1236 m68k_fetch_dst_ea M R 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1237 lsl status 8 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1238 or ccr scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1239 mov scratch1 dst |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1240 if M |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1241 cycles 4 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1242 else |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1243 cycles 2 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1244 end |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1245 m68k_save_dst 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1246 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1247 |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1248 01000000ZZMMMRRR negx |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1249 invalid M 1 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1250 invalid M 7 R 2 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1251 invalid M 7 R 3 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1252 invalid M 7 R 4 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1253 invalid M 7 R 5 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1254 invalid M 7 R 6 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1255 invalid M 7 R 7 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1256 m68k_fetch_dst_ea M R Z |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1257 sbc dst 0 dst Z |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1258 update_flags XNZVC |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1259 m68k_save_dst Z |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1260 m68k_prefetch |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1261 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1262 01000010ZZMMMRRR clr |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1263 invalid M 1 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1264 invalid M 7 R 2 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1265 invalid M 7 R 3 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1266 invalid M 7 R 4 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1267 invalid M 7 R 5 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1268 invalid M 7 R 6 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1269 invalid M 7 R 7 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1270 invalid Z 3 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1271 m68k_fetch_dst_ea M R Z |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1272 if Z = 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1273 if M = 0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1274 #register clears have 2 cycle penalty for longword size |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1275 cycles 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1276 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1277 end |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1278 dst:Z = 0 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1279 update_flags N0Z1V0C0 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1280 m68k_save_dst Z |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1281 m68k_prefetch |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1282 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1283 0100111001110000 reset |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1284 if reset_handler |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1285 pcall reset_handler m68k_reset_handler context |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1286 end |
2448
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1287 cycles 128 |
d1eec03dca09
Fix some issues in new 68K core and add implementations of negx and clr instructions
Michael Pavone <pavone@retrodev.com>
parents:
1991
diff
changeset
|
1288 m68k_prefetch |