Mercurial > repos > blastem
annotate m68k.cpu @ 2610:2de52352936c
Fix lsl in new CPU core and make asl less broken
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 15 Feb 2025 19:11:40 -0800 |
parents | b0a7b1f708cc |
children | 9bd90cd94000 |
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 |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
11 typedef m68k_context *(sync_fun)(m68k_context * context, uint32_t address); |
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
|
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); |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
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); |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
15 m68k_context *init_68k_context(m68k_options * opts, m68k_reset_handler *reset_handler); |
1838
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); |
2499
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
18 void m68k_serialize(m68k_context *context, uint32_t pc, serialize_buffer *buf); |
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
19 void m68k_deserialize(deserialize_buffer *buf, void *vcontext); |
2500
d44fe974fb85
Get blastem compiling with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2499
diff
changeset
|
20 void start_68k_context(m68k_context *context, uint32_t pc); |
2499
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
21 define NUM_MEM_AREAS 10 |
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
22 define M68K_OPT_BROKEN_READ_MODIFY 1 |
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
23 define INT_PENDING_SR_CHANGE 254 |
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
24 define INT_PENDING_NONE 255 |
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
25 define M68K_STATUS_TRACE 0x80 |
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
26 define m68k_invalidate_code_range(context, start, end) |
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
27 define m68k_options_free free |
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
28 define m68k_handle_code_write(address, context) |
2500
d44fe974fb85
Get blastem compiling with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2499
diff
changeset
|
29 define resume_68k(context) m68k_execute(context, context->target_cycle) |
d44fe974fb85
Get blastem compiling with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2499
diff
changeset
|
30 define insert_breakpoint(context, address, handler) |
d44fe974fb85
Get blastem compiling with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2499
diff
changeset
|
31 define remove_breakpoint(context, address) |
d44fe974fb85
Get blastem compiling with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2499
diff
changeset
|
32 define m68k_add_watchpoint(context, address, size) |
d44fe974fb85
Get blastem compiling with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2499
diff
changeset
|
33 define m68k_remove_watchpoint(context, address, size) |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
34 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
35 regs |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
36 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
|
37 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
|
38 pc 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
39 other_sp 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
40 scratch1 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
41 scratch2 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
42 int_cycle 32 |
2499
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
43 target_cycle 32 |
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
44 wp_hit_address 32 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
45 prefetch 16 |
2499
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
46 wp_hit_value 16 |
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
47 wp_old_value 16 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
48 int_priority 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
49 int_num 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
50 int_pending 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
51 int_pending_num 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
52 int_ack 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
53 status 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
54 ccr 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
55 xflag 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
56 nflag 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
57 zflag 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
58 vflag 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
59 cflag 8 |
2499
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
60 wp_hit 8 |
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
61 trace_pending 8 |
2500
d44fe974fb85
Get blastem compiling with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2499
diff
changeset
|
62 should_return 8 |
2499
d74d3998482c
Make some progress on compiling full emulator with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2498
diff
changeset
|
63 system ptrvoid |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
64 reset_handler ptrvoid |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
65 int_ack_handler ptrvoid |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
66 sync_components ptrsync_fun |
2500
d44fe974fb85
Get blastem compiling with new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2499
diff
changeset
|
67 mem_pointers ptr16 10 |
1838
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 flags |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
70 register ccr |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
71 X 4 carry xflag |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
72 N 3 sign nflag |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
73 Z 2 zero zflag |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
74 V 1 overflow vflag |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
75 C 0 carry cflag |
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 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
78 if dynarec |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
79 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
80 ccall m68k_read16_noinc context pc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
81 mov result prefetch |
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 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
84 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
85 if interp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
86 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
87 mov pc scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
88 ocall read_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
89 mov scratch1 prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
90 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
91 end |
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 add 2 pc pc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
94 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
95 check_user_mode_swap_ssp_usp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
96 local tmp 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
97 and 0x20 status tmp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
98 if tmp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
99 else |
2481
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
100 xchg other_sp a7 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
101 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
102 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
103 m68k_get_sr |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
104 lsl status 8 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
105 or ccr scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
106 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
107 m68k_write32_lowfirst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
108 arg value 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
109 add 2 scratch2 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
110 mov value scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
111 ocall write_16 |
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 sub 2 scratch2 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
114 lsr value 16 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
115 ocall write_16 |
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 m68k_write32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
118 arg value 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
119 local tmp 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
120 mov value tmp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
121 lsr value 16 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
122 ocall write_16 |
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 add 2 scratch2 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
125 mov tmp scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
126 ocall write_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
127 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
128 m68k_read32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
129 local tmp 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
130 add 2 scratch1 tmp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
131 ocall read_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
132 xchg scratch1 tmp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
133 ocall read_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
134 lsl tmp 16 tmp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
135 or tmp scratch1 scratch1 |
2562
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
136 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
137 m68k_trap |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
138 arg vector 32 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
139 check_user_mode_swap_ssp_usp |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
140 #save PC |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
141 a7 -= 4 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
142 scratch2 = a7 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
143 m68k_write32_lowfirst pc |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
144 #save SR |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
145 a7 -= 2 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
146 scratch2 = a7 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
147 m68k_get_sr |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
148 ocall write_16 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
149 #set supervisor bit |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
150 status |= 0x20 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
151 #clear trace bit |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
152 status &= 0x7F |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
153 trace_pending = 0 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
154 scratch1 = vector << 2 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
155 m68k_read32 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
156 pc = scratch1 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
157 cycles 10 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
158 m68k_prefetch |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
159 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
160 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
161 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
162 m68k_interrupt |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
163 if cycles >=U int_cycle |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
164 |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
165 #INT_PENDING_NONE |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
166 if 255 = int_pending |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
167 int_pending = int_priority |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
168 int_pending_num = int_num |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
169 else |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
170 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
171 #INT_PENDING_SR_CHANGE |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
172 if 254 = int_pending |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
173 int_pending = int_priority |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
174 int_pending_num = int_num |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
175 |
2580
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
176 end |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
177 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
178 check_user_mode_swap_ssp_usp |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
179 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
180 cycles 6 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
181 #save status reg |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
182 a7 -= 6 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
183 m68k_get_sr |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
184 scratch2 = a7 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
185 ocall write_16 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
186 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
187 #update status register |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
188 status &= 0x78 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
189 status |= int_pending |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
190 status |= 0x20 |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
191 |
2580
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
192 #Interrupt ack cycle |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
193 int_ack = int_pending |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
194 cycles 4 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
195 if int_ack_handler |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
196 pcall int_ack_handler int_ack_fun context |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
197 end |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
198 if int_pending_num |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
199 else |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
200 int_pending_num = int_pending + 24 |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
201 end |
2580
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
202 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
203 #save pc |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
204 scratch2 = a7 + 2 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
205 scratch1 = pc - 2 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
206 m68k_write32_lowfirst scratch1 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
207 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
208 scratch1 = int_pending_num << 2 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
209 int_pending = 255 #INT_PENDING_NONE |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
210 int_pending_num = 0 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
211 m68k_read32 |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
212 mov scratch1 pc |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
213 m68k_prefetch |
939b818df589
Get 68K interrupts working in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2578
diff
changeset
|
214 update_sync |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
215 end |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
216 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
217 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
218 m68k_run_op |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
219 dispatch prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
220 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
221 m68k_mem_src |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
222 arg address 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
223 arg size 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
224 arg isdst 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
225 mov address scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
226 if isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
227 mov address scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
228 meta ismem 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
229 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
230 switch size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
231 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
232 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
233 ocall read_8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
234 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
235 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
236 ocall read_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
237 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
238 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
239 m68k_read32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
240 |
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 meta op scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
243 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
244 m68k_write_size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
245 arg size 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
246 arg lowfirst 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
247 switch size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
248 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
249 ocall write_8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
250 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
251 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
252 ocall write_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
253 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
254 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
255 if lowfirst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
256 m68k_write32_lowfirst scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
257 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
258 m68k_write32 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
259 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
260 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
261 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
262 m68k_index_word |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
263 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
264 local disp 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
265 and prefetch 255 disp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
266 sext 16 disp disp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
267 sext 32 disp disp |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
268 local index 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
269 lsr prefetch 12 index |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
270 local isareg 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
271 and index 8 isareg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
272 and index 7 index |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
273 local islong 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
274 and prefetch 2048 islong |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
275 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
276 switch isareg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
277 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
278 switch islong |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
279 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
280 sext 32 dregs.index scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
281 case 2048 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
282 mov dregs.index scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
283 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
284 case 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
285 switch islong |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
286 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
287 sext 32 aregs.index scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
288 case 2048 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
289 mov aregs.index scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
290 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
291 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
292 add disp scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
293 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
294 m68k_fetch_op_ea |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
295 arg mode 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
296 arg reg 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
297 arg Z 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
298 arg isdst 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
299 switch mode |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
300 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
301 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
302 #data reg direct |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
303 meta op dregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
304 if isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
305 meta ismem 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
306 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
307 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
308 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
309 #address reg direct |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
310 meta op aregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
311 if isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
312 meta ismem 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
313 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
314 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
315 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
316 #address reg indirect |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
317 m68k_mem_src aregs.reg Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
318 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
319 case 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
320 #postincrement |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
321 m68k_mem_src aregs.reg Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
322 switch reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
323 case 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
324 if Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
325 addsize Z aregs.reg aregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
326 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
327 addsize 1 aregs.reg aregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
328 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
329 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
330 addsize Z aregs.reg aregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
331 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
332 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
333 case 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
334 #predecrement |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
335 switch reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
336 case 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
337 if Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
338 decsize Z aregs.reg aregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
339 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
340 decsize 1 aregs.reg aregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
341 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
342 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
343 decsize Z aregs.reg aregs.reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
344 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
345 cycles 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
346 m68k_mem_src aregs.reg 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 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
349 #displacement |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
350 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
351 sext 32 prefetch scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
352 add scratch1 aregs.reg scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
353 m68k_mem_src scratch1 Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
354 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
355 case 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
356 #indexed |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
357 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
|
358 cycles 2 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
359 add aregs.reg scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
360 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
361 m68k_mem_src scratch1 Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
362 case 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
363 #pc-relative and absolute modes |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
364 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
365 switch reg |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
366 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
367 #absolute short |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
368 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
369 sext 32 prefetch scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
370 m68k_mem_src scratch1 Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
371 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
372 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
373 #absolute long |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
374 local address 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
375 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
376 lsl prefetch 16 address |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
377 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
378 or prefetch address scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
379 m68k_mem_src scratch1 Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
380 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
381 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
382 #pc displaceent |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
383 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
384 sext 32 prefetch scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
385 add scratch1 pc scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
386 sub 2 scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
387 m68k_mem_src scratch1 Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
388 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
389 case 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
390 #pc indexed |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
391 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
|
392 cycles 2 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
393 add pc scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
394 sub 2 scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
395 m68k_mem_src scratch1 Z isdst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
396 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
397 case 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
398 #immediate |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
399 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
400 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
401 local tmp32 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
402 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
403 lsl prefetch 16 tmp32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
404 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
405 or prefetch tmp32 scratch1 |
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 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
408 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
409 mov prefetch scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
410 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
411 meta op scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
412 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
413 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
414 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
415 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
416 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
417 m68k_fetch_src_ea |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
418 arg mode 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
419 arg reg 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
420 arg Z 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
421 m68k_fetch_op_ea mode reg Z 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
422 meta src op |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
423 switch mode |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
424 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
425 meta src_is_mem 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
426 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
427 meta src_is_mem 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
428 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
429 meta src_is_mem 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
430 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
431 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
432 m68k_fetch_dst_ea |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
433 arg mode 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
434 arg reg 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
435 arg Z 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
436 m68k_fetch_op_ea mode reg Z 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
437 meta dst op |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
438 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
439 m68k_save_dst |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
440 arg Z 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
441 if ismem |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
442 m68k_write_size Z 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
443 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
444 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
445 1101DDD0ZZMMMRRR add_ea_dn |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
446 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
447 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
448 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
449 invalid Z 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
450 m68k_fetch_src_ea M R Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
451 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
452 add src dregs.D dregs.D Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
453 update_flags XNZVC |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
454 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
455 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
456 1101DDD1ZZMMMRRR add_dn_ea |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
457 invalid M 0 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
458 invalid M 1 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
459 invalid M 7 R 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
460 invalid M 7 R 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
461 invalid M 7 R 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
462 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
463 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
464 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
465 invalid Z 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
466 m68k_fetch_dst_ea M R Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
467 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
468 add dregs.D dst dst Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
469 update_flags XNZVC |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
470 m68k_save_dst Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
471 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
472 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
473 1101AAAZ11MMMRRR adda |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
474 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
475 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
476 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
477 local size 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
478 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
|
479 #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
|
480 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
|
481 size = 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
482 switch M |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
483 case 0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
484 #dreg src |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
485 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
486 case 1 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
487 #areg src |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
488 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
489 case 7 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
490 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
|
491 #immediate |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
492 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
493 else |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
494 cycles 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
495 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
496 default |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
497 cycles 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
498 end |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
499 else |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
500 size = 1 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
501 cycles 4 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
502 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
503 m68k_fetch_src_ea M R size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
504 switch size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
505 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
506 sext 32 src ext_src |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
507 meta src ext_src |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
508 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
509 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
510 add src aregs.A aregs.A |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
511 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
512 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
513 00000110ZZMMMRRR addi |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
514 local immed 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
515 invalid Z 3 |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
516 invalid M 1 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
517 invalid M 7 R 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
518 invalid M 7 R 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
519 invalid M 7 R 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
520 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
521 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
522 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
523 #fetch immediate operand |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
524 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
525 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
526 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
527 lsl prefetch 16 immed |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
528 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
529 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
|
530 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
|
531 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
532 end |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
533 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
534 mov prefetch immed |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
535 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
536 #fetch dst EA |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
537 m68k_fetch_dst_ea M R Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
538 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
539 add immed dst dst Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
540 update_flags XNZVC |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
541 m68k_save_dst Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
542 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
543 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
544 0101III0ZZMMMRRR addq |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
545 invalid Z 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
546 invalid M 7 R 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
547 invalid M 7 R 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
548 invalid M 7 R 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
549 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
550 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
551 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
552 local src 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
553 switch I |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
554 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
555 mov 8 src |
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 mov I src |
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 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
560 m68k_fetch_dst_ea M R Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
561 switch M |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
562 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
|
563 cycles 4 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
564 add src dst dst Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
565 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
566 add src dst dst Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
567 update_flags XNZVC |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
568 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
569 m68k_save_dst Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
570 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
571 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
572 1101DDD1ZZ000SSS addx_dy_dx |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
573 invalid Z 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
574 adc dregs.S dregs.D dregs.D Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
575 update_flags XNVC |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
576 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
577 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
|
578 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
|
579 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
|
580 if tmp8 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
581 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
|
582 end |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
583 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
|
584 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
|
585 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
|
586 if tmp16 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
587 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
|
588 end |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
589 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
|
590 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
591 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
|
592 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
|
593 end |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
594 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
595 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
596 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
597 1101DDD1ZZ001SSS addx_ay_ax |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
598 invalid Z 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
599 if Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
600 decsize Z aregs.S aregs.S |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
601 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
602 switch S |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
603 case 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
604 sub 2 aregs.S aregs.S |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
605 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
606 decsize Z aregs.S aregs.S |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
607 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
608 end |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
609 #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
|
610 cycles 2 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
611 mov aregs.S scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
612 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
613 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
614 ocall read_8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
615 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
616 ocall read_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
617 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
618 m68k_read32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
619 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
620 mov scratch1 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
621 if Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
622 decsize Z aregs.D aregs.D |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
623 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
624 switch D |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
625 case 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
626 sub 2 aregs.D aregs.D |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
627 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
628 decsize Z aregs.D aregs.D |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
629 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
630 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
631 mov aregs.D scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
632 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
633 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
634 ocall read_8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
635 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
636 ocall read_16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
637 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
638 m68k_read32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
639 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
640 adc scratch2 scratch1 scratch1 Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
641 update_flags XNVC |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
642 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
643 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
644 local tmp8 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
645 mov dregs.D tmp8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
646 if tmp8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
647 update_flags Z0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
648 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
649 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
650 local tmp16 16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
651 mov dregs.D tmp16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
652 if tmp16 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
653 update_flags Z0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
654 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
655 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
656 if dregs.D |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
657 update_flags Z0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
658 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
659 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
660 mov aregs.D scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
661 m68k_write_size Z 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
662 m68k_prefetch |
1939
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
663 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
664 1100DDD0ZZMMMRRR and_ea_dn |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
665 invalid M 1 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
666 invalid M 7 R 5 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
667 invalid M 7 R 6 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
668 invalid M 7 R 7 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
669 invalid Z 3 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
670 m68k_fetch_src_ea M R Z |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
671 |
1939
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
672 and src dregs.D dregs.D Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
673 update_flags NZV0C0 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
674 m68k_prefetch |
2562
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
675 |
2590
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
676 1100XXX100000YYY abcd_dy_dx |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
677 local lowx_corf 8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
678 local lowy_cmp 8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
679 local res 8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
680 lowx_corf = dregs.X & 0xF |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
681 lowy_cmp = dregs.Y & 0xF |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
682 adc lowx_corf lowy_cmp lowy_cmp |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
683 if lowy_cmp >=U 0xA |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
684 lowx_corf = 6 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
685 lowy_cmp = 0x9A |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
686 else |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
687 lowx_corf = 0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
688 lowy_cmp = 0xA0 |
2588
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
689 end |
2590
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
690 adc dregs.Y dregs.X res 0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
691 update_flags XC |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
692 if cflag |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
693 lowx_corf |= 0x60 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
694 res += lowx_corf |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
695 update_flags NV |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
696 else |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
697 if res >=U lowy_cmp |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
698 lowx_corf |= 0x60 |
2588
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
699 end |
2590
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
700 res += lowx_corf |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
701 update_flags XCNV |
2588
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
702 end |
2590
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
703 if res |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
704 update_flags Z0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
705 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
706 dregs.X:0 = res |
2588
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
707 cycles 2 |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
708 m68k_prefetch |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
709 |
2590
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
710 1100XXX100001YYY abcd_ay_ax |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
711 local lowx_corf 8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
712 local lowy_cmp 8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
713 local res 8 |
2588
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
714 if Y = 7 |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
715 aregs.Y -= 2 |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
716 else |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
717 aregs.Y -= 1 |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
718 end |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
719 #predec penalty on src only |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
720 cycles 2 |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
721 scratch1 = aregs.Y |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
722 ocall read_8 |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
723 scratch2 = scratch1 |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
724 if X = 7 |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
725 aregs.X -= 2 |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
726 else |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
727 aregs.X -= 1 |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
728 end |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
729 scratch1 = aregs.X |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
730 ocall read_8 |
2590
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
731 lowx_corf = scratch1 & 0xF |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
732 lowy_cmp = scratch2 & 0xF |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
733 adc lowx_corf lowy_cmp lowy_cmp |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
734 if lowy_cmp >=U 0xA |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
735 lowx_corf = 6 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
736 lowy_cmp = 0x9A |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
737 else |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
738 lowx_corf = 0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
739 lowy_cmp = 0xA0 |
2588
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
740 end |
2590
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
741 adc scratch2 scratch1 res 0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
742 update_flags XC |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
743 update_flags XC |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
744 if cflag |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
745 lowx_corf |= 0x60 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
746 res += lowx_corf |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
747 update_flags NV |
2588
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
748 else |
2590
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
749 if res >=U lowy_cmp |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
750 lowx_corf |= 0x60 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
751 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
752 res += lowx_corf |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
753 update_flags XCNV |
2588
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
754 end |
2590
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
755 if res |
2588
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
756 update_flags Z0 |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
757 end |
2590
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
758 scratch1 = res |
2588
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
759 scratch2 = aregs.X |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
760 ocall write_8 |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
761 m68k_prefetch |
0ea26288d983
Implement abcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2587
diff
changeset
|
762 |
2562
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
763 1100XXX101000YYY exg_dn_dn |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
764 scratch1 = dregs.X |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
765 dregs.X = dregs.Y |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
766 dregs.Y = scratch1 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
767 cycles 2 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
768 m68k_prefetch |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
769 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
770 1100XXX101001YYY exg_an_an |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
771 scratch1 = aregs.X |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
772 aregs.X = aregs.Y |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
773 aregs.Y = scratch1 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
774 cycles 2 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
775 m68k_prefetch |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
776 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
777 1100XXX110001YYY exg_dn_an |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
778 scratch1 = dregs.X |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
779 dregs.X = aregs.Y |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
780 aregs.Y = scratch1 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
781 cycles 2 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
782 m68k_prefetch |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
783 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
784 1100DDD011MMMRRR mulu |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
785 local a 16 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
786 local b 16 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
787 invalid M 1 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
788 invalid M 7 R 5 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
789 invalid M 7 R 6 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
790 invalid M 7 R 7 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
791 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
792 m68k_fetch_src_ea M R 1 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
793 #2-cycles per bit x 16, 2 for cleanup |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
794 cycles 34 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
795 #popcnt |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
796 a = src & 0b1010101010101010 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
797 a >>= 1 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
798 b = src & 0b0101010101010101 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
799 b += a |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
800 a = b & 0b1100110011001100 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
801 a >>= 2 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
802 b &= 0b0011001100110011 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
803 b += a |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
804 a = b & 0b1111000011110000 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
805 a >>= 4 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
806 b &= 0b0000111100001111 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
807 b += a |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
808 a = b & 0b1111111100000000 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
809 a >>= 8 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
810 b &= 0b0000000011111111 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
811 b += a |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
812 #2 cycles per set bit |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
813 b += b |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
814 cycles b |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
815 dregs.D = src * dregs.D |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
816 update_flags NZV0C0 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
817 m68k_prefetch |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
818 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
819 1100DDD111MMMRRR muls |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
820 local a 16 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
821 local b 16 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
822 invalid M 1 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
823 invalid M 7 R 5 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
824 invalid M 7 R 6 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
825 invalid M 7 R 7 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
826 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
827 m68k_fetch_src_ea M R 1 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
828 #2-cycles per bit x 16, 2 for cleanup |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
829 cycles 34 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
830 #muls timing is essentially the same as muls, but it's based on the number of 0/1 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
831 #transitions rather than the number of 1 bits. xoring the value with itself shifted |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
832 #by one effectively sets one bit for every transition |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
833 b = src << 1 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
834 b ^= src |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
835 #popcnt |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
836 a = b & 0b1010101010101010 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
837 a >>= 1 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
838 b &= 0b0101010101010101 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
839 b += a |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
840 a = b & 0b1100110011001100 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
841 a >>= 2 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
842 b &= 0b0011001100110011 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
843 b += a |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
844 a = b & 0b1111000011110000 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
845 a >>= 4 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
846 b &= 0b0000111100001111 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
847 b += a |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
848 a = b & 0b1111111100000000 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
849 a >>= 8 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
850 b &= 0b0000000011111111 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
851 b += a |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
852 #2 cycles per set bit |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
853 b += b |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
854 cycles b |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
855 dregs.D = src *S dregs.D |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
856 update_flags NZV0C0 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
857 m68k_prefetch |
1939
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
858 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
859 1100DDD1ZZMMMRRR and_dn_ea |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
860 invalid M 0 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
861 invalid M 1 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
862 invalid M 7 R 2 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
863 invalid M 7 R 3 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
864 invalid M 7 R 4 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
865 invalid M 7 R 5 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
866 invalid M 7 R 6 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
867 invalid M 7 R 7 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
868 invalid Z 3 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
869 m68k_fetch_dst_ea M R Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
870 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
871 and dregs.D dst dst Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
872 update_flags NZV0C0 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
873 m68k_save_dst Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
874 m68k_prefetch |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
875 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
876 00000010ZZMMMRRR andi |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
877 local immed 32 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
878 invalid Z 3 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
879 invalid M 1 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
880 invalid M 7 R 2 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
881 invalid M 7 R 3 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
882 invalid M 7 R 4 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
883 invalid M 7 R 5 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
884 invalid M 7 R 6 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
885 invalid M 7 R 7 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
886 #fetch immediate operand |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
887 m68k_prefetch |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
888 switch Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
889 case 2 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
890 lsl prefetch 16 immed |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
891 m68k_prefetch |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
892 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
|
893 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
|
894 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
895 end |
1939
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
896 default |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
897 mov prefetch immed |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
898 end |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
899 #fetch dst EA |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
900 m68k_fetch_dst_ea M R Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
901 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
902 and immed dst dst Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
903 update_flags NZV0C0 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
904 m68k_save_dst Z |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
905 m68k_prefetch |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
906 |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
907 0000001000111100 andi_to_ccr |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
908 #fetch immediate operand |
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
909 m68k_prefetch |
2583
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
910 ccr &= prefetch |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
911 cycles 12 #TODO: where do these occur relative to fetches |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
912 m68k_prefetch |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
913 |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
914 0000001001111100 andi_to_sr |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
915 #TODO: privilege violation exception if in user mode |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
916 #fetch immediate operand |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
917 m68k_prefetch |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
918 ccr &= prefetch |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
919 scratch1 = prefetch >> 8 |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
920 status &= scratch1 |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
921 check_user_mode_swap_ssp_usp |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
922 update_sync |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
923 cycles 12 #TODO: where do these occur relative to fetches |
1939
84b32010ef8d
Implement 68K and instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1838
diff
changeset
|
924 m68k_prefetch |
1940
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
925 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
926 1011DDD1ZZMMMRRR eor_dn_ea |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
927 invalid M 1 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
928 invalid M 7 R 2 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
929 invalid M 7 R 3 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
930 invalid M 7 R 4 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
931 invalid M 7 R 5 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
932 invalid M 7 R 6 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
933 invalid M 7 R 7 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
934 invalid Z 3 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
935 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
|
936 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
937 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
|
938 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
|
939 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
940 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
941 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
942 |
1940
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
943 xor dregs.D dst dst Z |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
944 update_flags NZV0C0 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
945 m68k_save_dst Z |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
946 m68k_prefetch |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
947 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
948 00001010ZZMMMRRR eori |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
949 local immed 32 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
950 invalid Z 3 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
951 invalid M 1 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
952 invalid M 7 R 2 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
953 invalid M 7 R 3 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
954 invalid M 7 R 4 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
955 invalid M 7 R 5 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
956 invalid M 7 R 6 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
957 invalid M 7 R 7 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
958 #fetch immediate operand |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
959 m68k_prefetch |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
960 switch Z |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
961 case 2 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
962 lsl prefetch 16 immed |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
963 m68k_prefetch |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
964 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
|
965 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
|
966 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
967 end |
1940
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
968 default |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
969 mov prefetch immed |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
970 end |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
971 #fetch dst EA |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
972 m68k_fetch_dst_ea M R Z |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
973 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
974 xor immed dst dst Z |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
975 update_flags NZV0C0 |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
976 m68k_save_dst Z |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
977 m68k_prefetch |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
978 |
2583
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
979 0000101000111100 eori_to_ccr |
1940
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
980 #fetch immediate operand |
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
981 m68k_prefetch |
2583
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
982 ccr ^= prefetch |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
983 cycles 12 #TODO: where do these occur relative to fetches |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
984 m68k_prefetch |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
985 |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
986 0000101001111100 eori_to_sr |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
987 #TODO: privilege violation exception if in user mode |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
988 #fetch immediate operand |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
989 m68k_prefetch |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
990 ccr ^= prefetch |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
991 scratch1 = prefetch >> 8 |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
992 status ^= scratch1 |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
993 check_user_mode_swap_ssp_usp |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
994 update_sync |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
995 cycles 12 #TODO: where do these occur relative to fetches |
1940
048442b0cb62
Implement 68K eor instruction in new core
Michael Pavone <pavone@retrodev.com>
parents:
1939
diff
changeset
|
996 m68k_prefetch |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
997 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
998 1000DDD0ZZMMMRRR or_ea_dn |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
999 invalid M 1 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1000 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1001 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1002 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1003 invalid Z 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1004 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
|
1005 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1006 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
|
1007 switch M |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1008 case 0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1009 #dreg |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1010 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1011 case 7 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1012 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
|
1013 #immediate |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1014 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1015 else |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1016 cycles 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1017 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1018 default |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1019 cycles 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1020 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1021 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1022 |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1023 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
|
1024 update_flags NZV0C0 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1025 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1026 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1027 1000DDD1ZZMMMRRR or_dn_ea |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1028 invalid M 0 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1029 invalid M 1 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1030 invalid M 7 R 2 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1031 invalid M 7 R 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1032 invalid M 7 R 4 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1033 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1034 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1035 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1036 invalid Z 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1037 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
|
1038 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1039 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
|
1040 update_flags NZV0C0 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1041 m68k_save_dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1042 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1043 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1044 00000000ZZMMMRRR ori |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1045 local immed 32 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1046 invalid Z 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1047 invalid M 1 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1048 invalid M 7 R 2 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1049 invalid M 7 R 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1050 invalid M 7 R 4 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1051 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1052 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1053 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1054 #fetch immediate operand |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1055 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1056 switch Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1057 case 2 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1058 lsl prefetch 16 immed |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1059 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1060 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
|
1061 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
|
1062 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1063 end |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1064 default |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1065 mov prefetch immed |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1066 end |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1067 #fetch dst EA |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1068 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
|
1069 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1070 or immed dst dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1071 update_flags NZV0C0 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1072 m68k_save_dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1073 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1074 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1075 0000000000111100 ori_to_ccr |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1076 #fetch immediate operand |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1077 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1078 or prefetch ccr ccr |
2583
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
1079 cycles 12 #TODO: where do these occur relative to fetches |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
1080 m68k_prefetch |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
1081 |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
1082 0000000001111100 ori_to_sr |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
1083 #TODO: privilege violation exception if in user mode |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
1084 #fetch immediate operand |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
1085 m68k_prefetch |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
1086 ccr |= prefetch |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
1087 scratch1 = prefetch >> 8 |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
1088 status |= scratch1 |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
1089 update_sync |
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
1090 cycles 12 #TODO: where do these occur relative to fetches |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1091 m68k_prefetch |
2587
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1092 |
2590
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1093 1000YYY100000XXX sbcd_dx_dy |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1094 local lowx_corf 8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1095 local lowy 8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1096 local res 8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1097 lowx_corf = dregs.X & 0xF |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1098 lowy = dregs.Y & 0xF |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1099 sbc lowx_corf lowy lowy |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1100 if lowy >=U 0x10 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1101 lowx_corf = 6 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1102 else |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1103 lowx_corf = 0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1104 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1105 sbc dregs.X dregs.Y res 0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1106 update_flags XC |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1107 if cflag |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1108 lowx_corf |= 0x60 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1109 res -= lowx_corf |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1110 update_flags NV |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1111 else |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1112 res -= lowx_corf |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1113 update_flags XCNV |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1114 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1115 if res |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1116 update_flags Z0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1117 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1118 dregs.Y:0 = res |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1119 cycles 2 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1120 m68k_prefetch |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1121 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1122 1000YYY100001XXX sbcd_ax_ay |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1123 local lowx_corf 8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1124 local lowy 8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1125 if X = 7 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1126 aregs.X -= 2 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1127 else |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1128 aregs.X -= 1 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1129 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1130 #predec penalty on src only |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1131 cycles 2 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1132 scratch1 = aregs.X |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1133 ocall read_8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1134 scratch2 = scratch1 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1135 if Y = 7 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1136 aregs.Y -= 2 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1137 else |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1138 aregs.Y -= 1 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1139 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1140 scratch1 = aregs.Y |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1141 ocall read_8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1142 lowy = scratch1 & 0xF |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1143 lowx_corf = scratch2 & 0xF |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1144 sbc lowx_corf lowy lowy |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1145 if lowy >=U 0x10 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1146 lowx_corf = 6 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1147 else |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1148 lowx_corf = 0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1149 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1150 sbc scratch2 scratch1 scratch1 0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1151 update_flags XC |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1152 if cflag |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1153 lowx_corf |= 0x60 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1154 scratch1:0 -= lowx_corf |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1155 update_flags NV |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1156 else |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1157 scratch1:0 -= lowx_corf |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1158 update_flags XCNV |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1159 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1160 scratch1 &= 0xFF |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1161 if scratch1 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1162 update_flags Z0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1163 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1164 scratch2 = aregs.Y |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1165 ocall write_8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1166 m68k_prefetch |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1167 |
2587
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1168 1000DDD011MMMRRR divu |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1169 invalid M 1 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1170 invalid M 7 R 5 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1171 invalid M 7 R 6 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1172 invalid M 7 R 7 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1173 m68k_fetch_src_ea M R 1 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1174 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1175 if src = 0 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1176 cycles 4 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1177 update_flags N0Z0V0 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1178 m68k_trap 5 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1179 else |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1180 ccall divu context D src |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1181 m68k_prefetch |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1182 end |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1183 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1184 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1185 1000DDD111MMMRRR divs |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1186 invalid M 1 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1187 invalid M 7 R 5 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1188 invalid M 7 R 6 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1189 invalid M 7 R 7 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1190 local tmp 32 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1191 m68k_fetch_src_ea M R 1 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1192 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1193 if src = 0 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1194 cycles 4 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1195 update_flags N0Z0V0 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1196 m68k_trap 5 |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1197 else |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1198 ccall divs context D src |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1199 m68k_prefetch |
e04c7e753bf6
Implement divs and divu in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2586
diff
changeset
|
1200 end |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1201 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1202 1001DDD0ZZMMMRRR sub_ea_dn |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1203 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1204 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1205 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1206 invalid Z 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1207 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
|
1208 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1209 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
|
1210 update_flags XNZVC |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1211 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1212 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1213 1001DDD1ZZMMMRRR sub_dn_ea |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1214 invalid M 0 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1215 invalid M 1 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1216 invalid M 7 R 2 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1217 invalid M 7 R 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1218 invalid M 7 R 4 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1219 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1220 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1221 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1222 invalid Z 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1223 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
|
1224 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1225 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
|
1226 update_flags XNZVC |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1227 m68k_save_dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1228 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1229 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1230 1001AAAZ11MMMRRR suba |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1231 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1232 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1233 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1234 local size 16 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1235 local ext_src 32 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1236 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
|
1237 size = 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1238 switch M |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1239 case 0 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1240 #dreg src |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1241 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1242 case 1 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1243 #areg src |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1244 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1245 case 7 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1246 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
|
1247 #immediate |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1248 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1249 else |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1250 cycles 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1251 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1252 default |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1253 cycles 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1254 end |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1255 else |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1256 size = 1 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1257 cycles 4 |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1258 end |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1259 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
|
1260 switch size |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1261 case 1 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1262 sext 32 src ext_src |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1263 meta src ext_src |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1264 end |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1265 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1266 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
|
1267 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1268 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1269 00000100ZZMMMRRR subi |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1270 local immed 32 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1271 invalid Z 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1272 invalid M 1 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1273 invalid M 7 R 2 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1274 invalid M 7 R 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1275 invalid M 7 R 4 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1276 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1277 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1278 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1279 #fetch immediate operand |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1280 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1281 switch Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1282 case 2 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1283 lsl prefetch 16 immed |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1284 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1285 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
|
1286 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
|
1287 cycles 4 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1288 end |
1941
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1289 default |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1290 mov prefetch immed |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1291 end |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1292 #fetch dst EA |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1293 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
|
1294 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1295 sub immed dst dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1296 update_flags XNZVC |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1297 m68k_save_dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1298 m68k_prefetch |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1299 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1300 0101III1ZZMMMRRR subq |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1301 invalid Z 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1302 invalid M 7 R 2 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1303 invalid M 7 R 3 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1304 invalid M 7 R 4 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1305 invalid M 7 R 5 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1306 invalid M 7 R 6 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1307 invalid M 7 R 7 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1308 local src 32 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1309 switch I |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1310 case 0 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1311 mov 8 src |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1312 default |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1313 mov I src |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1314 end |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1315 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1316 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
|
1317 switch M |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1318 case 1 |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1319 sub src dst dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1320 default |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1321 sub src dst dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1322 update_flags XNZVC |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1323 end |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1324 m68k_save_dst Z |
9eec86183aae
Implement 68K or and sub instructions in new core
Michael Pavone <pavone@retrodev.com>
parents:
1940
diff
changeset
|
1325 m68k_prefetch |
2586
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1326 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1327 1001DDD1ZZ000SSS subx_dy_dx |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1328 invalid Z 3 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1329 sbc dregs.S dregs.D dregs.D Z |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1330 update_flags XNVC |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1331 switch Z |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1332 case 0 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1333 local tmp8 8 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1334 mov dregs.D tmp8 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1335 if tmp8 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1336 update_flags Z0 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1337 end |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1338 case 1 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1339 local tmp16 16 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1340 mov dregs.D tmp16 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1341 if tmp16 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1342 update_flags Z0 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1343 end |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1344 case 2 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1345 cycles 4 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1346 if dregs.D |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1347 update_flags Z0 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1348 end |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1349 end |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1350 m68k_prefetch |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1351 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1352 1001DDD1ZZ001SSS subx_ay_ax |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1353 invalid Z 3 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1354 if Z |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1355 decsize Z aregs.S aregs.S |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1356 else |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1357 switch S |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1358 case 7 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1359 sub 2 aregs.S aregs.S |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1360 default |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1361 decsize Z aregs.S aregs.S |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1362 end |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1363 end |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1364 #predec penalty on src only |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1365 cycles 2 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1366 mov aregs.S scratch1 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1367 switch Z |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1368 case 0 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1369 ocall read_8 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1370 case 1 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1371 ocall read_16 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1372 case 2 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1373 m68k_read32 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1374 end |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1375 mov scratch1 scratch2 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1376 if Z |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1377 decsize Z aregs.D aregs.D |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1378 else |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1379 switch D |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1380 case 7 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1381 sub 2 aregs.D aregs.D |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1382 default |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1383 decsize Z aregs.D aregs.D |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1384 end |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1385 end |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1386 mov aregs.D scratch1 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1387 switch Z |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1388 case 0 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1389 ocall read_8 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1390 case 1 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1391 ocall read_16 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1392 case 2 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1393 m68k_read32 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1394 end |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1395 sbc scratch2 scratch1 scratch1 Z |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1396 update_flags XNVC |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1397 switch Z |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1398 case 0 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1399 local tmp8 8 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1400 mov dregs.D tmp8 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1401 if tmp8 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1402 update_flags Z0 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1403 end |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1404 case 1 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1405 local tmp16 16 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1406 mov dregs.D tmp16 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1407 if tmp16 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1408 update_flags Z0 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1409 end |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1410 case 2 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1411 if dregs.D |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1412 update_flags Z0 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1413 end |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1414 end |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1415 mov aregs.D scratch2 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1416 m68k_write_size Z 0 |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1417 m68k_prefetch |
6c58cadeabe1
Implement subx in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2585
diff
changeset
|
1418 |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1419 1110CCC0ZZ001RRR lsri |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1420 invalid Z 3 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1421 switch C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1422 case 0 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1423 meta shift 8 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1424 default |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1425 meta shift C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1426 end |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1427 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
|
1428 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
|
1429 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
|
1430 cyc = shift + shift |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1431 switch Z |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1432 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
|
1433 cyc += 4 |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1434 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
|
1435 cyc += 2 |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1436 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
|
1437 cycles cyc |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1438 #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
|
1439 m68k_prefetch |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1440 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1441 1110CCC0ZZ101RRR lsr_dn |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1442 invalid Z 3 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1443 local shift 8 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1444 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
|
1445 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
|
1446 update_flags XNZV0C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1447 add shift shift shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1448 switch Z |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1449 case 2 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1450 add 4 shift shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1451 default |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1452 add 2 shift shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1453 end |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1454 cycles shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1455 #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
|
1456 m68k_prefetch |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1457 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1458 1110001011MMMRRR lsr_ea |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1459 invalid M 0 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1460 invalid M 1 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1461 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
|
1462 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
|
1463 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
|
1464 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
|
1465 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
|
1466 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
|
1467 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1468 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
|
1469 lsr dst 1 dst |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1470 update_flags XNZV0C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1471 m68k_save_dst 0 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1472 m68k_prefetch |
2502
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1473 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1474 1110CCC0ZZ000RRR asri |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1475 invalid Z 3 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1476 switch C |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1477 case 0 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1478 meta shift 8 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1479 default |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1480 meta shift C |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1481 end |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1482 asr dregs.R shift dregs.R Z |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1483 update_flags XNZV0C |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1484 local cyc 32 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1485 cyc = shift + shift |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1486 switch Z |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1487 case 2 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1488 cyc += 4 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1489 default |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1490 cyc += 2 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1491 end |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1492 cycles cyc |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1493 #TODO: should this happen before or after the majority of the shift? |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1494 m68k_prefetch |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1495 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1496 1110CCC0ZZ100RRR asr_dn |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1497 invalid Z 3 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1498 local shift 32 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1499 local shift_cycles 32 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1500 and dregs.C 63 shift |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1501 shift_cycles = shift |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1502 if shift = 0 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1503 cmp 0 dregs.R Z |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1504 update_flags NZV0C0 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1505 else |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1506 switch Z |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1507 case 0 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1508 if shift >=U 9 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1509 shift = 8 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1510 end |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1511 case 1 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1512 if shift >=U 17 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1513 shift = 16 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1514 end |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1515 case 2 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1516 if shift >=U 33 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1517 shift = 32 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1518 end |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1519 end |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1520 asr dregs.R shift dregs.R Z |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1521 update_flags XNZV0C |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1522 end |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1523 shift_cycles += shift_cycles |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1524 switch Z |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1525 case 2 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1526 shift_cycles += 4 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1527 default |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1528 shift_cycles += 2 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1529 end |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1530 cycles shift_cycles |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1531 #TODO: should this happen before or after the majority of the shift? |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1532 m68k_prefetch |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1533 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1534 1110000011MMMRRR asr_ea |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1535 invalid M 0 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1536 invalid M 1 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1537 invalid M 7 R 2 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1538 invalid M 7 R 3 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1539 invalid M 7 R 4 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1540 invalid M 7 R 5 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1541 invalid M 7 R 6 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1542 invalid M 7 R 7 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1543 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1544 m68k_fetch_dst_ea M R 0 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1545 asr dst 1 dst |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1546 update_flags XNZV0C |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1547 m68k_save_dst 0 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1548 m68k_prefetch |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1549 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1550 1110CCC1ZZ001RRR lsli |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1551 invalid Z 3 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1552 switch C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1553 case 0 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1554 meta shift 8 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1555 default |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1556 meta shift C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1557 end |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1558 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
|
1559 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
|
1560 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
|
1561 cyc = shift + shift |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1562 switch Z |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1563 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
|
1564 cyc += 4 |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1565 default |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1566 cyc += 2 |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1567 end |
2450
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1568 cycles cyc |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1569 #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
|
1570 m68k_prefetch |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1571 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1572 1110CCC1ZZ101RRR lsl_dn |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1573 invalid Z 3 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1574 local shift 8 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1575 and dregs.C 63 shift |
2610
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1576 switch Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1577 case 2 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1578 if shift >=U 32 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1579 if shift = 32 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1580 lsl dregs.R 31 dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1581 lsl dregs.R 1 dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1582 update_flags XN0Z1V0C |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1583 else |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1584 dregs.R:Z = 0 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1585 update_flags X0N0Z1V0C0 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1586 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1587 else |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1588 lsl dregs.R shift dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1589 update_flags NZV0C |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1590 if shift |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1591 xflag = cflag |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1592 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1593 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1594 case 1 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1595 if shift >=U 16 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1596 if shift = 16 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1597 lsl dregs.R 15 dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1598 lsl dregs.R 1 dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1599 update_flags XN0Z1V0C |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1600 else |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1601 dregs.R:Z = 0 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1602 update_flags X0N0Z1V0C0 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1603 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1604 else |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1605 lsl dregs.R shift dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1606 update_flags NZV0C |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1607 if shift |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1608 xflag = cflag |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1609 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1610 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1611 case 0 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1612 if shift >=U 8 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1613 if shift = 8 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1614 lsl dregs.R 7 dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1615 lsl dregs.R 1 dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1616 update_flags XN0Z1V0C |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1617 else |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1618 dregs.R:Z = 0 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1619 update_flags X0N0Z1V0C0 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1620 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1621 else |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1622 lsl dregs.R shift dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1623 update_flags NZV0C |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1624 if shift |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1625 xflag = cflag |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1626 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1627 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1628 end |
1991
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1629 add shift shift shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1630 switch Z |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1631 case 2 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1632 add 4 shift shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1633 default |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1634 add 2 shift shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1635 end |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1636 cycles shift |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1637 #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
|
1638 m68k_prefetch |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1639 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1640 1110001111MMMRRR lsl_ea |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1641 invalid M 0 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1642 invalid M 1 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1643 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
|
1644 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
|
1645 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
|
1646 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
|
1647 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
|
1648 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
|
1649 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1650 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
|
1651 lsl dst 1 dst |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1652 update_flags XNZV0C |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1653 m68k_save_dst 0 |
7d4df6b74263
Somewhat buggy implementations of shift instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
1941
diff
changeset
|
1654 m68k_prefetch |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1655 |
2502
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1656 1110CCC1ZZ000RRR asli |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1657 invalid Z 3 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1658 switch C |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1659 case 0 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1660 meta shift 8 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1661 default |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1662 meta shift C |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1663 end |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1664 lsl dregs.R shift dregs.R Z |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1665 update_flags XNZV0C |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1666 local cyc 32 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1667 cyc = shift + shift |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1668 switch Z |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1669 case 2 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1670 cyc += 4 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1671 default |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1672 cyc += 2 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1673 end |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1674 cycles cyc |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1675 #TODO: should this happen before or after the majority of the shift? |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1676 m68k_prefetch |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1677 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1678 1110CCC1ZZ100RRR asl_dn |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1679 invalid Z 3 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1680 local shift 8 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1681 and dregs.C 63 shift |
2610
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1682 #TODO: implement loops and do this a bit at a time to implement V flag |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1683 switch Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1684 case 2 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1685 if shift >=U 32 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1686 if shift = 32 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1687 lsl dregs.R 31 dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1688 lsl dregs.R 1 dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1689 update_flags XNZ1V0C |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1690 else |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1691 dregs.R:Z = 0 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1692 update_flags X0N0Z1V0C0 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1693 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1694 else |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1695 lsl dregs.R shift dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1696 update_flags NZV0C |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1697 if shift |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1698 xflag = cflag |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1699 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1700 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1701 case 1 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1702 if shift >=U 16 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1703 if shift = 16 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1704 lsl dregs.R 15 dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1705 lsl dregs.R 1 dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1706 update_flags XN0Z1V0C |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1707 else |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1708 dregs.R:Z = 0 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1709 update_flags X0N0Z1V0C0 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1710 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1711 else |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1712 lsl dregs.R shift dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1713 update_flags NZV0C |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1714 if shift |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1715 xflag = cflag |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1716 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1717 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1718 case 0 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1719 if shift >=U 8 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1720 if shift = 8 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1721 lsl dregs.R 7 dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1722 lsl dregs.R 1 dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1723 update_flags XN0Z1V0C |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1724 else |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1725 dregs.R:Z = 0 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1726 update_flags X0N0Z1V0C0 |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1727 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1728 else |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1729 lsl dregs.R shift dregs.R Z |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1730 update_flags NZV0C |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1731 if shift |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1732 xflag = cflag |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1733 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1734 end |
2de52352936c
Fix lsl in new CPU core and make asl less broken
Michael Pavone <pavone@retrodev.com>
parents:
2593
diff
changeset
|
1735 end |
2502
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1736 add shift shift shift |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1737 switch Z |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1738 case 2 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1739 add 4 shift shift |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1740 default |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1741 add 2 shift shift |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1742 end |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1743 cycles shift |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1744 #TODO: should this happen before or after the majority of the shift? |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1745 m68k_prefetch |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1746 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1747 1110000111MMMRRR asl_ea |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1748 invalid M 0 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1749 invalid M 1 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1750 invalid M 7 R 2 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1751 invalid M 7 R 3 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1752 invalid M 7 R 4 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1753 invalid M 7 R 5 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1754 invalid M 7 R 6 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1755 invalid M 7 R 7 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1756 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1757 m68k_fetch_dst_ea M R 0 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1758 lsl dst 1 dst |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1759 update_flags XNZV0C |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1760 m68k_save_dst 0 |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1761 m68k_prefetch |
ad50530a7c27
Partially functional asr/asl implementations in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2501
diff
changeset
|
1762 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1763 00ZZRRRMMMEEESSS move |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1764 invalid Z 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1765 invalid M 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1766 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
|
1767 invalid E 7 S 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1768 invalid E 7 S 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1769 invalid E 7 S 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1770 local size 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1771 local memsrc 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1772 #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
|
1773 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1774 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1775 mov 0 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1776 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1777 mov 2 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1778 case 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1779 mov 1 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1780 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1781 m68k_fetch_src_ea E S size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1782 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1783 if src_is_mem |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1784 #avoid clobbering src if we need scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1785 mov src memsrc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1786 meta src memsrc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1787 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1788 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1789 cmp 0 src size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1790 update_flags NZV0C0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1791 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1792 switch M |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1793 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1794 mov src dregs.R size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1795 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1796 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1797 mov aregs.R scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1798 mov src scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1799 m68k_write_size size 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1800 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1801 case 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1802 mov aregs.R scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1803 mov src scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1804 switch R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1805 case 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1806 if size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1807 addsize size aregs.R aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1808 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1809 addsize 1 aregs.R aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1810 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1811 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1812 addsize size aregs.R aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1813 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1814 m68k_write_size size 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1815 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1816 case 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1817 mov src scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1818 switch R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1819 case 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1820 if size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1821 decsize size aregs.R aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1822 else |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1823 decsize 1 aregs.R aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1824 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1825 default |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1826 decsize size aregs.R aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1827 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1828 mov aregs.R scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1829 m68k_write_size size 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1830 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1831 case 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1832 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1833 sext 32 prefetch scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1834 add aregs.R scratch2 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1835 mov src scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1836 m68k_write_size size 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1837 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1838 case 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1839 m68k_index_word |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1840 add aregs.R scratch1 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1841 mov src scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1842 m68k_write_size size 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1843 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1844 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1845 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1846 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1847 00ZZ00M111EEESSS move_abs |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1848 invalid E 7 S 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1849 invalid E 7 S 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1850 invalid E 7 S 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1851 invalid Z 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1852 local size 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1853 local memsrc 32 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1854 #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
|
1855 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1856 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1857 mov 0 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1858 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1859 mov 2 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1860 case 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1861 mov 1 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1862 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1863 m68k_fetch_src_ea E S size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1864 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1865 if src_is_mem |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1866 #avoid clobbering src if we need scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1867 mov src memsrc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1868 meta src memsrc |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1869 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1870 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1871 cmp 0 src size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1872 update_flags NZV0C0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1873 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1874 switch M |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1875 case 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1876 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1877 sext 32 prefetch scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1878 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1879 case 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1880 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1881 lsl prefetch 16 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1882 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1883 or prefetch scratch2 scratch2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1884 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1885 mov src scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1886 m68k_write_size size 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1887 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1888 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1889 00ZZRRR001EEESSS movea |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1890 local size 8 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1891 invalid Z 0 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1892 invalid Z 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1893 invalid E 7 S 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1894 invalid E 7 S 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1895 invalid E 7 S 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1896 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1897 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1898 mov 2 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1899 case 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1900 mov 1 size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1901 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1902 m68k_fetch_src_ea E S size |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1903 switch Z |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1904 case 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1905 mov src aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1906 case 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1907 sext 32 src aregs.R |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1908 end |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1909 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1910 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1911 0100010011MMMRRR move_to_ccr |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1912 invalid M 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1913 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1914 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1915 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1916 m68k_fetch_src_ea M R 1 |
2590
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1917 mov src 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
|
1918 cycles 8 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1919 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1920 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1921 0100011011MMMRRR move_to_sr |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1922 invalid M 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1923 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1924 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1925 invalid M 7 R 7 |
2481
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
1926 #TODO: privilege violation exception if in user mode |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1927 m68k_fetch_src_ea M R 1 |
2590
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1928 ccr = src |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1929 status = src >> 8 |
2583
0f7609fe03f2
Implement andi/ori/eori to sr, fix eori to ccr in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2580
diff
changeset
|
1930 check_user_mode_swap_ssp_usp |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1931 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
|
1932 cycles 8 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1933 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1934 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1935 0100000011MMMRRR move_from_sr |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1936 invalid M 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1937 invalid M 7 R 2 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1938 invalid M 7 R 3 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1939 invalid M 7 R 4 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1940 invalid M 7 R 5 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1941 invalid M 7 R 6 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1942 invalid M 7 R 7 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1943 m68k_fetch_dst_ea M R 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1944 lsl status 8 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1945 or ccr scratch1 scratch1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1946 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
|
1947 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
|
1948 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
|
1949 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
|
1950 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
|
1951 end |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1952 m68k_save_dst 1 |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1953 m68k_prefetch |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1954 |
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
|
1955 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
|
1956 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
|
1957 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
|
1958 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
|
1959 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
|
1960 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
|
1961 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
|
1962 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
|
1963 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
|
1964 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
|
1965 update_flags XNZVC |
2464
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
1966 if Z = 2 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
1967 if M = 0 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
1968 cycles 2 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
1969 end |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
1970 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
|
1971 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
|
1972 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
|
1973 |
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
|
1974 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
|
1975 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
|
1976 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
|
1977 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
|
1978 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
|
1979 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
|
1980 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
|
1981 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
|
1982 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
|
1983 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
|
1984 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
|
1985 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
|
1986 #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
|
1987 cycles 2 |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1988 end |
6c93869babc1
Fix cycle counts for a number of instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2448
diff
changeset
|
1989 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
|
1990 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
|
1991 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
|
1992 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
|
1993 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
|
1994 |
2590
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1995 0100100000MMMRRR nbcd |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1996 local lowx_corf 8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1997 local lowy_cmp 8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1998 local res 8 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
1999 invalid M 1 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2000 invalid M 7 R 2 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2001 invalid M 7 R 3 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2002 invalid M 7 R 4 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2003 invalid M 7 R 5 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2004 invalid M 7 R 6 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2005 invalid M 7 R 7 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2006 m68k_fetch_dst_ea M R 0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2007 lowx_corf = dst & 0xF |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2008 lowy_cmp = 0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2009 sbc lowx_corf lowy_cmp lowy_cmp |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2010 if lowy_cmp >= 0xA |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2011 lowx_corf = 6 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2012 lowy_cmp = 0xA6 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2013 else |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2014 lowx_corf = 0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2015 lowy_cmp = 0xA0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2016 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2017 res = 0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2018 sbc dst res res |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2019 update_flags XC |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2020 if cflag |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2021 lowx_corf |= 0x60 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2022 res -= lowx_corf |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2023 update_flags NV |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2024 else |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2025 if res >=U lowy_cmp |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2026 lowx_corf |= 0x60 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2027 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2028 res -= lowx_corf |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2029 update_flags XCNV |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2030 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2031 if res |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2032 update_flags Z0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2033 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2034 dst:0 = res |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2035 if M = 0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2036 cycles 2 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2037 end |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2038 m68k_save_dst 0 |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2039 m68k_prefetch |
e602dbf776d8
Fix abcd and implement sbcd and nbcd in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2588
diff
changeset
|
2040 |
2453
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2041 00001100ZZMMMRRR cmpi |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2042 local immed 32 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2043 invalid Z 3 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2044 invalid M 1 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2045 invalid M 7 R 2 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2046 invalid M 7 R 3 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2047 invalid M 7 R 4 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2048 invalid M 7 R 5 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2049 invalid M 7 R 6 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2050 invalid M 7 R 7 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2051 #fetch immediate operand |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2052 m68k_prefetch |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2053 switch Z |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2054 case 2 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2055 immed = prefetch << 16 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2056 m68k_prefetch |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2057 immed |= prefetch |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2058 if M = 0 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2059 cycles 2 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2060 end |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2061 default |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2062 immed = prefetch |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2063 end |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2064 #fetch dst EA |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2065 m68k_fetch_dst_ea M R Z |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2066 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2067 cmp immed dst Z |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2068 update_flags NZVC |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2069 m68k_prefetch |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2070 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2071 1011DDD1ZZ001SSS cmpm |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2072 invalid Z 3 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2073 scratch1 = aregs.S |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2074 switch Z |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2075 case 0 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2076 ocall read_8 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2077 case 1 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2078 ocall read_16 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2079 case 2 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2080 m68k_read32 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2081 end |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2082 scratch2 = scratch1 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2083 if Z |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2084 addsize Z aregs.S aregs.S |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2085 else |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2086 if S = 7 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2087 aregs.S += 2 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2088 else |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2089 aregs.S += 1 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2090 end |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2091 end |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2092 scratch1 = aregs.D |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2093 switch Z |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2094 case 0 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2095 ocall read_8 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2096 case 1 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2097 ocall read_16 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2098 case 2 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2099 m68k_read32 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2100 end |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2101 if Z |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2102 addsize Z aregs.D aregs.D |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2103 else |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2104 if D = 7 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2105 aregs.D += 2 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2106 else |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2107 aregs.D += 1 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2108 end |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2109 end |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2110 cmp scratch2 scratch1 Z |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2111 update_flags NZVC |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2112 m68k_prefetch |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2113 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2114 1011DDD0ZZMMMRRR cmp |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2115 invalid M 7 R 5 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2116 invalid M 7 R 6 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2117 invalid M 7 R 7 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2118 invalid Z 3 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2119 m68k_fetch_src_ea M R Z |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2120 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2121 if Z = 2 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2122 cycles 2 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2123 end |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2124 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2125 cmp src dregs.D Z |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2126 update_flags NZVC |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2127 m68k_prefetch |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2128 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2129 1011DDDZ11MMMRRR cmpa |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2130 invalid M 7 R 5 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2131 invalid M 7 R 6 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2132 invalid M 7 R 7 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2133 local size 16 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2134 local ext_src 32 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2135 if Z |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2136 size = 2 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2137 else |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2138 size = 1 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2139 end |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2140 m68k_fetch_src_ea M R size |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2141 cycles 2 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2142 if size = 1 |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2143 sext 32 src ext_src |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2144 meta src ext_src |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2145 end |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2146 cmp src aregs.D |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2147 update_flags NZVC |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2148 m68k_prefetch |
7d7525769ce2
Implement cmp instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2450
diff
changeset
|
2149 |
2454
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2150 0000100000MMMRRR btsti |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2151 invalid M 1 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2152 invalid M 7 R 5 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2153 invalid M 7 R 6 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2154 invalid M 7 R 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2155 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2156 local tmp 32 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2157 m68k_prefetch |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2158 if M |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2159 tmp = scratch1 & 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2160 meta size 0 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2161 else |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2162 cycles 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2163 tmp = scratch1 & 31 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2164 meta size 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2165 end |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2166 tmp = 1 << tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2167 m68k_fetch_src_ea M R size |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2168 tmp &= src |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2169 update_flags Z |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2170 m68k_prefetch |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2171 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2172 0000100001MMMRRR bchgi |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2173 invalid M 1 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2174 invalid M 7 R 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2175 invalid M 7 R 3 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2176 invalid M 7 R 4 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2177 invalid M 7 R 5 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2178 invalid M 7 R 6 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2179 invalid M 7 R 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2180 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2181 local tmp 32 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2182 local tmp2 32 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2183 m68k_prefetch |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2184 if M |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2185 tmp = scratch1 & 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2186 meta size 0 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2187 else |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2188 tmp = scratch1 & 31 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2189 meta size 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2190 if tmp >=U 16 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2191 cycles 4 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2192 else |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2193 cycles 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2194 end |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2195 end |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2196 tmp = 1 << tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2197 m68k_fetch_dst_ea M R size |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2198 tmp2 = tmp & dst |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2199 update_flags Z |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2200 dst ^= tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2201 m68k_save_dst size |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2202 m68k_prefetch |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2203 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2204 0000100010MMMRRR bclri |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2205 invalid M 1 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2206 invalid M 7 R 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2207 invalid M 7 R 3 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2208 invalid M 7 R 4 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2209 invalid M 7 R 5 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2210 invalid M 7 R 6 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2211 invalid M 7 R 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2212 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2213 local tmp 32 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2214 local tmp2 32 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2215 m68k_prefetch |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2216 if M |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2217 tmp = scratch1 & 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2218 meta size 0 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2219 else |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2220 tmp = scratch1 & 31 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2221 meta size 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2222 if tmp >=U 16 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2223 cycles 6 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2224 else |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2225 cycles 4 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2226 end |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2227 end |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2228 tmp = 1 << tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2229 m68k_fetch_dst_ea M R size |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2230 tmp2 = tmp & dst |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2231 update_flags Z |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2232 tmp = ~tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2233 dst &= tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2234 m68k_save_dst size |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2235 m68k_prefetch |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2236 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2237 0000100011MMMRRR bseti |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2238 invalid M 1 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2239 invalid M 7 R 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2240 invalid M 7 R 3 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2241 invalid M 7 R 4 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2242 invalid M 7 R 5 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2243 invalid M 7 R 6 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2244 invalid M 7 R 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2245 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2246 local tmp 32 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2247 local tmp2 32 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2248 m68k_prefetch |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2249 if M |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2250 tmp = scratch1 & 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2251 meta size 0 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2252 else |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2253 tmp = scratch1 & 31 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2254 meta size 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2255 if tmp >=U 16 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2256 cycles 4 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2257 else |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2258 cycles 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2259 end |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2260 end |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2261 tmp = 1 << tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2262 m68k_fetch_dst_ea M R size |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2263 tmp2 = tmp & dst |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2264 update_flags Z |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2265 dst |= tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2266 m68k_save_dst size |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2267 m68k_prefetch |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2268 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2269 0000SSS100MMMRRR btst_dn |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2270 invalid M 1 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2271 invalid M 7 R 5 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2272 invalid M 7 R 6 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2273 invalid M 7 R 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2274 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2275 local tmp 32 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2276 if M |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2277 tmp = dregs.S & 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2278 meta size 0 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2279 else |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2280 tmp = dregs.S & 31 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2281 meta size 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2282 cycles 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2283 end |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2284 tmp = 1 << tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2285 m68k_fetch_src_ea M R size |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2286 tmp &= src |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2287 update_flags Z |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2288 m68k_prefetch |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2289 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2290 0000SSS101MMMRRR bchg_dn |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2291 invalid M 1 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2292 invalid M 7 R 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2293 invalid M 7 R 3 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2294 invalid M 7 R 4 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2295 invalid M 7 R 5 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2296 invalid M 7 R 6 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2297 invalid M 7 R 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2298 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2299 local tmp 32 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2300 local tmp2 32 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2301 if M |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2302 tmp = dregs.S & 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2303 meta size 0 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2304 else |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2305 tmp = dregs.S & 31 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2306 meta size 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2307 if tmp >=U 16 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2308 cycles 4 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2309 else |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2310 cycles 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2311 end |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2312 end |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2313 tmp = 1 << tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2314 m68k_fetch_dst_ea M R size |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2315 tmp2 = tmp & dst |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2316 update_flags Z |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2317 dst ^= tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2318 m68k_save_dst size |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2319 m68k_prefetch |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2320 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2321 0000SSS110MMMRRR bclr_dn |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2322 invalid M 1 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2323 invalid M 7 R 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2324 invalid M 7 R 3 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2325 invalid M 7 R 4 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2326 invalid M 7 R 5 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2327 invalid M 7 R 6 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2328 invalid M 7 R 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2329 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2330 local tmp 32 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2331 local tmp2 32 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2332 if M |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2333 tmp = dregs.S & 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2334 meta size 0 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2335 else |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2336 tmp = dregs.S & 31 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2337 meta size 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2338 if tmp >=U 16 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2339 cycles 6 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2340 else |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2341 cycles 4 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2342 end |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2343 end |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2344 tmp = 1 << tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2345 m68k_fetch_dst_ea M R size |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2346 tmp2 = tmp & dst |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2347 update_flags Z |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2348 tmp = ~tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2349 dst &= tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2350 m68k_save_dst size |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2351 m68k_prefetch |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2352 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2353 0000SSS111MMMRRR bset_dn |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2354 invalid M 1 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2355 invalid M 7 R 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2356 invalid M 7 R 3 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2357 invalid M 7 R 4 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2358 invalid M 7 R 5 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2359 invalid M 7 R 6 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2360 invalid M 7 R 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2361 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2362 local tmp 32 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2363 local tmp2 32 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2364 if M |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2365 tmp = dregs.S & 7 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2366 meta size 0 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2367 else |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2368 tmp = dregs.S & 31 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2369 meta size 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2370 if tmp >=U 16 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2371 cycles 4 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2372 else |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2373 cycles 2 |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2374 end |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2375 end |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2376 tmp = 1 << tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2377 m68k_fetch_dst_ea M R size |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2378 tmp2 = tmp & dst |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2379 update_flags Z |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2380 dst |= tmp |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2381 m68k_save_dst size |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2382 m68k_prefetch |
b1e8e7554f2f
Implement bit instructions in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2453
diff
changeset
|
2383 |
2456
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2384 0000DDD10Z001AAA movep_ay_dx |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2385 local address 32 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2386 m68k_prefetch |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2387 scratch1 += aregs.A |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2388 address = scratch1 + 2 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2389 ocall read_8 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2390 dregs.D:1 = scratch1 << 8 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2391 scratch1 = address |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2392 ocall read_8 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2393 dregs.D:0 = scratch1 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2394 if Z |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2395 address += 2 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2396 scratch1 = address |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2397 dregs.D <<= 16 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2398 ocall read_8 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2399 dregs.D:1 = scratch1 << 8 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2400 scratch1 = address + 2 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2401 ocall read_8 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2402 dregs.D:0 = scratch1 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2403 end |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2404 m68k_prefetch |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2405 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2406 0000DDD11Z001AAA movep_dx_ay |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2407 m68k_prefetch |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2408 scratch2 = scratch1 + aregs.A |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2409 if Z |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2410 scratch1 = dregs.D >> 24 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2411 ocall write_8 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2412 scratch2 += 2 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2413 scratch1 = dregs.D >> 16 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2414 ocall write_8 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2415 scratch2 += 2 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2416 end |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2417 scratch1 = dregs.D >> 8 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2418 ocall write_8 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2419 scratch2 += 2 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2420 scratch1 = dregs.D |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2421 ocall write_8 |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2422 m68k_prefetch |
72d0eac49507
Implement movep in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2454
diff
changeset
|
2423 |
2464
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2424 01000100ZZMMMRRR neg |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2425 invalid Z 3 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2426 invalid M 1 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2427 invalid M 7 R 2 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2428 invalid M 7 R 3 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2429 invalid M 7 R 4 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2430 invalid M 7 R 5 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2431 invalid M 7 R 6 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2432 invalid M 7 R 7 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2433 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2434 m68k_fetch_dst_ea M R Z |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2435 dst:Z = -dst |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2436 update_flags XNZVC |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2437 if Z = 2 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2438 if M = 0 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2439 cycles 2 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2440 end |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2441 end |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2442 m68k_save_dst Z |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2443 m68k_prefetch |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2444 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2445 01000110ZZMMMRRR not |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2446 invalid Z 3 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2447 invalid M 1 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2448 invalid M 7 R 2 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2449 invalid M 7 R 3 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2450 invalid M 7 R 4 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2451 invalid M 7 R 5 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2452 invalid M 7 R 6 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2453 invalid M 7 R 7 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2454 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2455 m68k_fetch_dst_ea M R Z |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2456 dst:Z = ~dst |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2457 update_flags NZV0C0 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2458 if Z = 2 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2459 if M = 0 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2460 cycles 2 |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2461 end |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2462 end |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2463 m68k_save_dst Z |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2464 m68k_prefetch |
f9d5c137c74b
Implement neg and not instructions in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2456
diff
changeset
|
2465 |
2468
0ca78837e4d2
Implement ext instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2464
diff
changeset
|
2466 01001000ZZ000RRR ext |
0ca78837e4d2
Implement ext instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2464
diff
changeset
|
2467 invalid Z 0 |
0ca78837e4d2
Implement ext instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2464
diff
changeset
|
2468 invalid Z 1 |
0ca78837e4d2
Implement ext instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2464
diff
changeset
|
2469 if Z = 3 |
0ca78837e4d2
Implement ext instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2464
diff
changeset
|
2470 meta bits 32 |
0ca78837e4d2
Implement ext instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2464
diff
changeset
|
2471 else |
0ca78837e4d2
Implement ext instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2464
diff
changeset
|
2472 meta bits 16 |
0ca78837e4d2
Implement ext instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2464
diff
changeset
|
2473 end |
0ca78837e4d2
Implement ext instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2464
diff
changeset
|
2474 sext bits dregs.R dregs.R |
0ca78837e4d2
Implement ext instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2464
diff
changeset
|
2475 update_flags NZV0C0 |
0ca78837e4d2
Implement ext instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2464
diff
changeset
|
2476 m68k_prefetch |
0ca78837e4d2
Implement ext instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2464
diff
changeset
|
2477 |
2562
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
2478 010011100100VVVV trap |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
2479 local vector 32 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
2480 scratch1 = pc |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
2481 vector = V + 32 |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
2482 m68k_trap vector |
595719fe69f2
Implement exg, muls and mulu in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2502
diff
changeset
|
2483 |
2470
6bec9e66d0db
Implement link instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2468
diff
changeset
|
2484 0100111001010RRR link |
6bec9e66d0db
Implement link instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2468
diff
changeset
|
2485 a7 -= 4 |
6bec9e66d0db
Implement link instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2468
diff
changeset
|
2486 scratch2 = a7 |
6bec9e66d0db
Implement link instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2468
diff
changeset
|
2487 #TODO: confirm order of fetch and write |
6bec9e66d0db
Implement link instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2468
diff
changeset
|
2488 m68k_write32 aregs.R |
6bec9e66d0db
Implement link instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2468
diff
changeset
|
2489 m68k_prefetch |
6bec9e66d0db
Implement link instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2468
diff
changeset
|
2490 aregs.R = a7 |
6bec9e66d0db
Implement link instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2468
diff
changeset
|
2491 sext 32 scratch1 scratch1 |
6bec9e66d0db
Implement link instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2468
diff
changeset
|
2492 a7 += scratch1 |
6bec9e66d0db
Implement link instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2468
diff
changeset
|
2493 m68k_prefetch |
6bec9e66d0db
Implement link instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2468
diff
changeset
|
2494 |
2479
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2495 0100111001011RRR unlk |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2496 a7 = aregs.R |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2497 scratch1 = a7 |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2498 m68k_read32 |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2499 a7 += 4 |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2500 aregs.R = scratch1 |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2501 m68k_prefetch |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2502 |
2472
f171a12fc98c
Implement swap instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2470
diff
changeset
|
2503 0100100001000RRR swap |
f171a12fc98c
Implement swap instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2470
diff
changeset
|
2504 ror dregs.R 16 dregs.R |
f171a12fc98c
Implement swap instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2470
diff
changeset
|
2505 update_flags NZV0C0 |
f171a12fc98c
Implement swap instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2470
diff
changeset
|
2506 m68k_prefetch |
2478
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2507 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2508 m68k_calc_ea |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2509 arg mode 16 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2510 arg reg 16 |
2498
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2511 arg index_penalty 32 |
2478
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2512 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2513 switch mode |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2514 case 2 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2515 #address reg indirect |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2516 meta ea aregs.reg |
2498
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2517 case 3 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2518 #postincrement |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2519 meta ea aregs.reg |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2520 case 4 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2521 #predecrement |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2522 #note: this case is only used when m68k_calc_ea |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2523 #is called from movem_reg_to_mem which does its own decrementing |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2524 meta ea aregs.reg |
2478
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2525 case 5 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2526 #displacement |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2527 m68k_prefetch |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2528 sext 32 prefetch scratch1 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2529 scratch1 += aregs.reg |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2530 meta ea scratch1 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2531 case 6 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2532 #index |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2533 m68k_index_word |
2498
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2534 cycles index_penalty |
2478
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2535 scratch1 += aregs.reg |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2536 meta ea scratch1 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2537 case 7 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2538 switch reg |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2539 case 0 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2540 #absolute short |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2541 m68k_prefetch |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2542 sext 32 prefetch scratch1 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2543 case 1 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2544 #absoltue long |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2545 m68k_prefetch |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2546 scratch2 = prefetch << 16 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2547 m68k_prefetch |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2548 scratch1 = scratch2 | prefetch |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2549 case 2 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2550 #pc displacement |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2551 m68k_prefetch |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2552 sext 32 prefetch scratch1 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2553 scratch1 += pc |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2554 scratch1 -= 2 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2555 case 3 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2556 #pc indexed |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2557 m68k_index_word |
2498
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2558 cycles index_penalty |
2478
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2559 scratch1 += pc |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2560 scratch1 -= 2 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2561 end |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2562 meta ea scratch1 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2563 end |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2564 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2565 0100100001MMMRRR pea |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2566 invalid M 0 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2567 invalid M 1 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2568 invalid M 3 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2569 invalid M 4 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2570 invalid M 7 R 4 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2571 invalid M 7 R 5 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2572 invalid M 7 R 6 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2573 invalid M 7 R 7 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2574 |
2498
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2575 m68k_calc_ea M R 4 |
2478
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2576 scratch2 = a7 - 4 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2577 m68k_write32_lowfirst ea |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2578 a7 -= 4 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2579 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2580 m68k_prefetch |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2581 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2582 0100DDD111MMMRRR lea |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2583 invalid M 0 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2584 invalid M 1 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2585 invalid M 3 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2586 invalid M 4 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2587 invalid M 7 R 4 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2588 invalid M 7 R 5 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2589 invalid M 7 R 6 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2590 invalid M 7 R 7 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2591 |
2498
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2592 m68k_calc_ea M R 4 |
2478
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2593 aregs.D = ea |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2594 |
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2595 m68k_prefetch |
2479
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2596 |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2597 01001010ZZMMMRRR tst |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2598 invalid M 7 R 5 |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2599 invalid M 7 R 6 |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2600 invalid M 7 R 7 |
2478
ea37200967c7
Implement lea and pea in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2472
diff
changeset
|
2601 |
2479
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2602 m68k_fetch_dst_ea M R Z |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2603 |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2604 cmp 0 dst Z |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2605 update_flags NZV0C0 |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2606 m68k_prefetch |
2472
f171a12fc98c
Implement swap instruction in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2470
diff
changeset
|
2607 |
1838
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2608 0100111001110000 reset |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2609 if reset_handler |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2610 pcall reset_handler m68k_reset_handler context |
0c1491818f4b
WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2611 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
|
2612 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
|
2613 m68k_prefetch |
2479
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2614 |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2615 0100111001110001 nop |
29baf8d5a579
Implement unlk, tst and nop in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2478
diff
changeset
|
2616 m68k_prefetch |
2481
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2617 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2618 0100111001110011 rte |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2619 #TODO: privilege violation exception if in user mode |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2620 #Read saved SR |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2621 scratch1 = a7 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2622 ocall read_16 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2623 a7 += 2 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2624 ccr = scratch1 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2625 status = scratch1 >> 8 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2626 #Read saved PC |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2627 scratch1 = a7 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2628 m68k_read32 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2629 a7 += 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2630 pc = scratch1 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2631 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2632 check_user_mode_swap_ssp_usp |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2633 cycles 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2634 update_sync |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2635 m68k_prefetch |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2636 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2637 0100111001110101 m68k_rts |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2638 scratch1 = a7 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2639 m68k_read32 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2640 a7 += 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2641 pc = scratch1 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2642 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2643 cycles 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2644 m68k_prefetch |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2645 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2646 0100111001110111 rtr |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2647 #Read saved CCR |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2648 scratch1 = a7 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2649 ocall read_16 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2650 a7 += 2 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2651 ccr = scratch1 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2652 #Read saved PC |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2653 scratch1 = a7 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2654 m68k_read32 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2655 a7 += 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2656 pc = scratch1 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2657 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2658 cycles 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2659 m68k_prefetch |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2660 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2661 0100111010MMMRRR jsr |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2662 invalid M 0 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2663 invalid M 1 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2664 invalid M 3 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2665 invalid M 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2666 invalid M 7 R 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2667 invalid M 7 R 5 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2668 invalid M 7 R 6 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2669 invalid M 7 R 7 |
2585
c730067d5f77
Fix jsr in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2584
diff
changeset
|
2670 local tmp 32 |
c730067d5f77
Fix jsr in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2584
diff
changeset
|
2671 |
c730067d5f77
Fix jsr in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2584
diff
changeset
|
2672 m68k_calc_ea M R 2 |
c730067d5f77
Fix jsr in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2584
diff
changeset
|
2673 tmp = ea |
2481
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2674 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2675 a7 -= 4 |
2501
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2676 scratch2 = a7 |
2481
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2677 m68k_write32 pc |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2678 |
2585
c730067d5f77
Fix jsr in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2584
diff
changeset
|
2679 pc = tmp |
2481
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2680 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2681 cycles 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2682 m68k_prefetch |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2683 |
2501
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2684 0100111011MMMRRR jmp |
2481
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2685 invalid M 0 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2686 invalid M 1 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2687 invalid M 3 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2688 invalid M 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2689 invalid M 7 R 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2690 invalid M 7 R 5 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2691 invalid M 7 R 6 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2692 invalid M 7 R 7 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2693 |
2498
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2694 m68k_calc_ea M R 2 |
2481
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2695 pc = ea |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2696 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2697 cycles 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2698 m68k_prefetch |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2699 |
2498
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2700 m68k_movem_reg_to_mem |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2701 arg reglist 16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2702 arg mask 16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2703 arg reg 32 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2704 arg size 16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2705 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2706 scratch1 = reglist & mask |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2707 if scratch1 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2708 scratch2 = addr |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2709 scratch1 = reg |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2710 m68k_write_size size 1 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2711 addsize size addr addr |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2712 end |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2713 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2714 m68k_movem_reg_to_mem_dec |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2715 arg reglist 16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2716 arg mask 16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2717 arg reg 32 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2718 arg size 16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2719 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2720 scratch1 = reglist & mask |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2721 if scratch1 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2722 decsize size addr addr |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2723 scratch2 = addr |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2724 scratch1 = reg |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2725 m68k_write_size size 1 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2726 end |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2727 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2728 |
2481
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2729 010010001ZMMMRRR movem_reg_to_mem |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2730 invalid M 0 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2731 invalid M 1 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2732 invalid M 3 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2733 invalid M 7 R 2 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2734 invalid M 7 R 3 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2735 invalid M 7 R 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2736 invalid M 7 R 5 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2737 invalid M 7 R 6 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2738 invalid M 7 R 7 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2739 local reglist 16 |
2498
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2740 local address 32 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2741 local sz 16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2742 sz = Z + 1 |
2481
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2743 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2744 m68k_prefetch |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2745 reglist = scratch1 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2746 |
2498
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2747 m68k_calc_ea M R 2 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2748 address = ea |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2749 meta addr address |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2750 if M = 4 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2751 m68k_movem_reg_to_mem_dec reglist 1 a7 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2752 m68k_movem_reg_to_mem_dec reglist 2 a6 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2753 m68k_movem_reg_to_mem_dec reglist 4 a5 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2754 m68k_movem_reg_to_mem_dec reglist 8 a4 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2755 m68k_movem_reg_to_mem_dec reglist 16 a3 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2756 m68k_movem_reg_to_mem_dec reglist 32 a2 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2757 m68k_movem_reg_to_mem_dec reglist 64 a1 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2758 m68k_movem_reg_to_mem_dec reglist 128 a0 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2759 m68k_movem_reg_to_mem_dec reglist 256 d7 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2760 m68k_movem_reg_to_mem_dec reglist 512 d6 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2761 m68k_movem_reg_to_mem_dec reglist 1024 d5 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2762 m68k_movem_reg_to_mem_dec reglist 2048 d4 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2763 m68k_movem_reg_to_mem_dec reglist 4096 d3 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2764 m68k_movem_reg_to_mem_dec reglist 8192 d2 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2765 m68k_movem_reg_to_mem_dec reglist 16384 d1 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2766 m68k_movem_reg_to_mem_dec reglist 32768 d0 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2767 ea = address |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2768 else |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2769 m68k_movem_reg_to_mem reglist 1 d0 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2770 m68k_movem_reg_to_mem reglist 2 d1 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2771 m68k_movem_reg_to_mem reglist 4 d2 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2772 m68k_movem_reg_to_mem reglist 8 d3 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2773 m68k_movem_reg_to_mem reglist 16 d4 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2774 m68k_movem_reg_to_mem reglist 32 d5 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2775 m68k_movem_reg_to_mem reglist 64 d6 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2776 m68k_movem_reg_to_mem reglist 128 d7 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2777 m68k_movem_reg_to_mem reglist 256 a0 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2778 m68k_movem_reg_to_mem reglist 512 a1 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2779 m68k_movem_reg_to_mem reglist 1024 a2 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2780 m68k_movem_reg_to_mem reglist 2048 a3 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2781 m68k_movem_reg_to_mem reglist 4096 a4 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2782 m68k_movem_reg_to_mem reglist 8192 a5 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2783 m68k_movem_reg_to_mem reglist 16384 a6 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2784 m68k_movem_reg_to_mem reglist 32768 a7 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2785 end |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2786 m68k_prefetch |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2787 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2788 m68k_movem_mem_to_dreg |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2789 arg reglist 16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2790 arg mask 16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2791 arg reg 32 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2792 arg size 16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2793 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2794 scratch1 = reglist & mask |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2795 if scratch1 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2796 scratch1 = addr |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2797 if sz = 1 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2798 ocall read_16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2799 sext 32 scratch1 dregs.reg |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2800 else |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2801 m68k_read32 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2802 dregs.reg = scratch1 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2803 end |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2804 addsize size addr addr |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2805 end |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2806 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2807 m68k_movem_mem_to_areg |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2808 arg reglist 16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2809 arg mask 16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2810 arg reg 32 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2811 arg size 16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2812 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2813 scratch1 = reglist & mask |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2814 if scratch1 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2815 scratch1 = addr |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2816 if sz = 1 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2817 ocall read_16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2818 sext 32 scratch1 aregs.reg |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2819 else |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2820 m68k_read32 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2821 aregs.reg = scratch1 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2822 end |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2823 addsize size addr addr |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2824 end |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2825 |
2481
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2826 010011001ZMMMRRR movem_mem_to_reg |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2827 invalid M 0 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2828 invalid M 1 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2829 invalid M 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2830 invalid M 7 R 4 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2831 invalid M 7 R 5 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2832 invalid M 7 R 6 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2833 invalid M 7 R 7 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2834 local reglist 16 |
2498
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2835 local address 32 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2836 local sz 16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2837 sz = Z + 1 |
2481
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2838 |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2839 m68k_prefetch |
f0645adddf0d
Implement some flow control instructions in new 68K core. WIP implementation of movem in new 68K core.
Michael Pavone <pavone@retrodev.com>
parents:
2479
diff
changeset
|
2840 reglist = scratch1 |
2498
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2841 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2842 m68k_calc_ea M R 2 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2843 address = ea |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2844 meta addr address |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2845 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2846 m68k_movem_mem_to_dreg reglist 1 0 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2847 m68k_movem_mem_to_dreg reglist 2 1 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2848 m68k_movem_mem_to_dreg reglist 4 2 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2849 m68k_movem_mem_to_dreg reglist 8 3 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2850 m68k_movem_mem_to_dreg reglist 16 4 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2851 m68k_movem_mem_to_dreg reglist 32 5 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2852 m68k_movem_mem_to_dreg reglist 64 6 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2853 m68k_movem_mem_to_dreg reglist 128 7 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2854 m68k_movem_mem_to_areg reglist 256 0 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2855 m68k_movem_mem_to_areg reglist 512 1 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2856 m68k_movem_mem_to_areg reglist 1024 2 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2857 m68k_movem_mem_to_areg reglist 2048 3 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2858 m68k_movem_mem_to_areg reglist 4096 4 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2859 m68k_movem_mem_to_areg reglist 8192 5 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2860 m68k_movem_mem_to_areg reglist 16384 6 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2861 m68k_movem_mem_to_areg reglist 32768 7 sz |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2862 #dummy read |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2863 scratch1 = address |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2864 ocall read_16 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2865 if M = 3 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2866 ea = address |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2867 end |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2868 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2869 m68k_prefetch |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2870 |
2501
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2871 0100111001100RRR move_to_usp |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2872 #TODO: trap if not in supervisor mode |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2873 other_sp = aregs.R |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2874 m68k_prefetch |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2875 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2876 0100111001101RRR move_from_usp |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2877 #TODO: trap if not in supervisor mode |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2878 aregs.R = other_sp |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2879 m68k_prefetch |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2880 |
2498
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2881 0111RRR0IIIIIIII moveq |
2591
563d05355a12
Cut down on code bloat in 68K core a little
Michael Pavone <pavone@retrodev.com>
parents:
2590
diff
changeset
|
2882 nospecialize I |
2498
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2883 local tmp 32 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2884 sext 16 I tmp |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2885 sext 32 tmp dregs.R |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2886 cmp 0 dregs.R |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2887 update_flags NZV0C0 |
dffda054d218
Implement movem and moveq in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2481
diff
changeset
|
2888 m68k_prefetch |
2501
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2889 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2890 0110000100000000 bsr_w |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2891 #mid-instruction timing isn't quite right |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2892 #becuase I'm only emulating a 1-word prefetch buffer instead of 2 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2893 local offset 32 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2894 m68k_prefetch |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2895 sext 32 prefetch offset |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2896 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2897 a7 -= 4 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2898 scratch2 = a7 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2899 m68k_write32 pc |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2900 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2901 pc += offset |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2902 pc -= 2 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2903 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2904 cycles 2 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2905 m68k_prefetch |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2906 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2907 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2908 01100001DDDDDDDD bsr |
2591
563d05355a12
Cut down on code bloat in 68K core a little
Michael Pavone <pavone@retrodev.com>
parents:
2590
diff
changeset
|
2909 nospecialize D |
2501
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2910 #mid-instruction timing isn't quite right |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2911 #becuase I'm only emulating a 1-word prefetch buffer instead of 2 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2912 local offset 32 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2913 sext 16 D offset |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2914 sext 32 offset offset |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2915 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2916 a7 -= 4 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2917 scratch2 = a7 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2918 m68k_write32 pc |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2919 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2920 pc += offset |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2921 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2922 cycles 6 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2923 m68k_prefetch |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2924 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2925 m68k_check_cond |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2926 arg cond 16 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2927 local invert 8 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2928 switch cond |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2929 case 0 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2930 #true |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2931 meta istrue 1 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2932 case 1 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2933 #false |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2934 meta istrue 0 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2935 case 2 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2936 #high |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2937 meta istrue invert |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2938 invert = zflag | cflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2939 invert = !invert |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2940 case 3 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2941 #low or same |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2942 meta istrue invert |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2943 invert = zflag | cflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2944 case 4 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2945 #carry clear |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2946 meta istrue invert |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2947 invert = !cflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2948 case 5 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2949 #carry set |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2950 meta istrue cflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2951 case 6 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2952 #not equal |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2953 meta istrue invert |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2954 invert = !zflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2955 case 7 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2956 #equal |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2957 meta istrue zflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2958 case 8 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2959 #overflow clear |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2960 meta istrue invert |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2961 invert = !vflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2962 case 9 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2963 #overflow set |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2964 meta istrue vflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2965 case 10 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2966 #plus |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2967 meta istrue invert |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2968 invert = !nflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2969 case 11 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2970 #minus |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2971 meta istrue nflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2972 case 12 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2973 #greater or equal |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2974 meta istrue invert |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2975 invert = nflag - vflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2976 invert = !invert |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2977 case 13 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2978 #less |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2979 meta istrue invert |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2980 invert = nflag - vflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2981 case 14 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2982 #greater |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2983 meta istrue invert |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2984 invert = vflag ^ nflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2985 invert |= zflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2986 invert = !invert |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2987 case 15 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2988 #less or equal |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2989 meta istrue invert |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2990 invert = vflag ^ nflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2991 invert |= zflag |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2992 end |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
2993 |
2584
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
2994 0101CCCC11MMMDDD scc |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
2995 invalid M 1 |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
2996 invalid M 7 D 2 |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
2997 invalid M 7 D 3 |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
2998 invalid M 7 D 4 |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
2999 invalid M 7 D 5 |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3000 invalid M 7 D 6 |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3001 invalid M 7 D 7 |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3002 m68k_fetch_dst_ea M D 0 |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3003 m68k_check_cond C |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3004 if istrue |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3005 if M = 0 |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3006 cycles 2 |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3007 end |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3008 dst:0 = 0xFF |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3009 else |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3010 dst:0 = 0 |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3011 end |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3012 m68k_save_dst 0 |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3013 m68k_prefetch |
5851240f71c9
Implement scc in new 68K core
Michael Pavone <pavone@retrodev.com>
parents:
2583
diff
changeset
|
3014 |
2501
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3015 0110CCCC00000000 bcc_w |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3016 #mid-instruction timing isn't quite right |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3017 #becuase I'm only emulating a 1-word prefetch buffer instead of 2 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3018 local offset 32 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3019 m68k_prefetch |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3020 m68k_check_cond C |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3021 if istrue |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3022 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3023 sext 32 prefetch offset |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3024 pc += offset |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3025 pc -= 2 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3026 cycles 2 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3027 else |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3028 cycles 4 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3029 end |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3030 m68k_prefetch |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3031 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3032 0110CCCCDDDDDDDD bcc |
2591
563d05355a12
Cut down on code bloat in 68K core a little
Michael Pavone <pavone@retrodev.com>
parents:
2590
diff
changeset
|
3033 nospecialize D |
2501
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3034 #mid-instruction timing isn't quite right |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3035 #becuase I'm only emulating a 1-word prefetch buffer instead of 2 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3036 local offset 32 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3037 m68k_check_cond C |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3038 if istrue |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3039 sext 16 D offset |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3040 sext 32 offset offset |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3041 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3042 pc += offset |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3043 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3044 cycles 6 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3045 else |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3046 cycles 4 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3047 end |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3048 m68k_prefetch |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3049 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3050 0101CCCC11001RRR dbcc |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3051 local offset 32 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3052 local tmp 16 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3053 m68k_prefetch |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3054 m68k_check_cond C |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3055 if istrue |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3056 cycles 4 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3057 else |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3058 dregs.R:1 -= 1 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3059 tmp = dregs.R |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3060 if tmp = 65535 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3061 cycles 6 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3062 else |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3063 sext 32 prefetch offset |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3064 pc += offset |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3065 pc -= 2 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3066 cycles 2 |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3067 end |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3068 end |
6cd5a1d76e34
Implement some more instructions in new 68K core. First light with some old demos
Michael Pavone <pavone@retrodev.com>
parents:
2500
diff
changeset
|
3069 m68k_prefetch |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3070 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3071 1110CCC0ZZ011RRR rori |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3072 invalid Z 3 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3073 switch C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3074 case 0 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3075 meta shift 8 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3076 default |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3077 meta shift C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3078 end |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3079 ror dregs.R shift dregs.R Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3080 update_flags NZV0C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3081 local cyc 32 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3082 cyc = shift + shift |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3083 switch Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3084 case 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3085 cyc += 4 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3086 default |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3087 cyc += 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3088 end |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3089 cycles cyc |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3090 #TODO: should this happen before or after the majority of the rotate? |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3091 m68k_prefetch |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3092 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3093 1110CCC0ZZ111RRR ror_dn |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3094 invalid Z 3 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3095 local shift 8 |
2578
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3096 shift = dregs.C & 63 |
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3097 ror dregs.R shift dregs.R Z |
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3098 update_flags NZV0C |
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3099 shift += shift |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3100 switch Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3101 case 2 |
2578
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3102 shift += 4 |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3103 default |
2578
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3104 shift += 2 |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3105 end |
2578
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3106 cycles shift |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3107 #TODO: should this happen before or after the majority of the rotate? |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3108 m68k_prefetch |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3109 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3110 1110011011MMMRRR ror_ea |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3111 invalid M 0 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3112 invalid M 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3113 invalid M 7 R 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3114 invalid M 7 R 3 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3115 invalid M 7 R 4 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3116 invalid M 7 R 5 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3117 invalid M 7 R 6 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3118 invalid M 7 R 7 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3119 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3120 m68k_fetch_dst_ea M R 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3121 ror dst 1 dst 1 |
2578
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3122 update_flags NZV0C |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3123 m68k_save_dst 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3124 m68k_prefetch |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3125 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3126 1110CCC1ZZ011RRR roli |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3127 invalid Z 3 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3128 switch C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3129 case 0 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3130 meta shift 8 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3131 default |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3132 meta shift C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3133 end |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3134 rol dregs.R shift dregs.R Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3135 update_flags NZV0C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3136 local cyc 32 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3137 cyc = shift + shift |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3138 switch Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3139 case 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3140 cyc += 4 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3141 default |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3142 cyc += 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3143 end |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3144 cycles cyc |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3145 #TODO: should this happen before or after the majority of the rotate? |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3146 m68k_prefetch |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3147 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3148 1110CCC1ZZ111RRR rol_dn |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3149 invalid Z 3 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3150 local shift 8 |
2578
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3151 shift = dregs.C & 63 |
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3152 rol dregs.R shift dregs.R Z |
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3153 update_flags NZV0C |
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3154 shift += shift |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3155 switch Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3156 case 2 |
2578
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3157 shift += 4 |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3158 default |
2578
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3159 shift += 2 |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3160 end |
2578
9b01541cbd60
Fix rol and ror in new CPU core
Michael Pavone <pavone@retrodev.com>
parents:
2577
diff
changeset
|
3161 cycles shift |
2577
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3162 #TODO: should this happen before or after the majority of the rotate? |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3163 m68k_prefetch |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3164 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3165 1110011111MMMRRR rol_ea |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3166 invalid M 0 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3167 invalid M 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3168 invalid M 7 R 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3169 invalid M 7 R 3 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3170 invalid M 7 R 4 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3171 invalid M 7 R 5 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3172 invalid M 7 R 6 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3173 invalid M 7 R 7 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3174 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3175 m68k_fetch_dst_ea M R 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3176 rol dst 1 dst 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3177 update_flags NZV0C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3178 m68k_save_dst 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3179 m68k_prefetch |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3180 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3181 1110CCC0ZZ010RRR roxri |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3182 invalid Z 3 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3183 switch C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3184 case 0 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3185 meta shift 8 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3186 default |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3187 meta shift C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3188 end |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3189 rrc dregs.R shift dregs.R Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3190 update_flags XNZV0C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3191 local cyc 32 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3192 cyc = shift + shift |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3193 switch Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3194 case 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3195 cyc += 4 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3196 default |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3197 cyc += 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3198 end |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3199 cycles cyc |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3200 #TODO: should this happen before or after the majority of the rotate? |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3201 m68k_prefetch |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3202 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3203 1110CCC0ZZ110RRR roxr_dn |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3204 invalid Z 3 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3205 local shift 8 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3206 local cycle_shift 8 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3207 cycle_shift = dregs.C & 63 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3208 switch Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3209 case 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3210 if cycle_shift = 32 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3211 rrc dregs.R 31 dregs.R Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3212 rrc dregs.R 1 dregs.R Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3213 update_flags NZV0C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3214 else |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3215 shift = dregs.C & 31 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3216 rrc dregs.R shift dregs.R Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3217 update_flags NZV0C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3218 end |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3219 default |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3220 shift = dregs.C & 31 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3221 rrc dregs.R shift dregs.R Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3222 update_flags XNZV0C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3223 end |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3224 cycle_shift += cycle_shift |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3225 switch Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3226 case 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3227 cycle_shift += 4 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3228 default |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3229 cycle_shift += 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3230 end |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3231 cycles cycle_shift |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3232 #TODO: should this happen before or after the majority of the rotate? |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3233 m68k_prefetch |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3234 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3235 1110010011MMMRRR roxr_ea |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3236 invalid M 0 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3237 invalid M 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3238 invalid M 7 R 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3239 invalid M 7 R 3 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3240 invalid M 7 R 4 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3241 invalid M 7 R 5 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3242 invalid M 7 R 6 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3243 invalid M 7 R 7 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3244 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3245 m68k_fetch_dst_ea M R 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3246 rrc dst 1 dst 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3247 update_flags XNZV0C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3248 m68k_save_dst 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3249 m68k_prefetch |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3250 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3251 1110CCC1ZZ010RRR roxli |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3252 invalid Z 3 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3253 switch C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3254 case 0 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3255 meta shift 8 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3256 default |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3257 meta shift C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3258 end |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3259 rlc dregs.R shift dregs.R Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3260 update_flags XNZV0C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3261 local cyc 32 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3262 cyc = shift + shift |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3263 switch Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3264 case 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3265 cyc += 4 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3266 default |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3267 cyc += 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3268 end |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3269 cycles cyc |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3270 #TODO: should this happen before or after the majority of the rotate? |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3271 m68k_prefetch |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3272 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3273 1110CCC1ZZ110RRR roxl_dn |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3274 invalid Z 3 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3275 local shift 8 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3276 local cycle_shift 8 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3277 cycle_shift = dregs.C & 63 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3278 switch Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3279 case 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3280 if cycle_shift = 32 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3281 rrc dregs.R 31 dregs.R Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3282 rlc dregs.R 1 dregs.R Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3283 update_flags NZV0C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3284 else |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3285 shift = dregs.C & 31 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3286 rlc dregs.R shift dregs.R Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3287 update_flags NZV0C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3288 end |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3289 default |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3290 shift = dregs.C & 31 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3291 rlc dregs.R shift dregs.R Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3292 update_flags XNZV0C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3293 end |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3294 cycle_shift += cycle_shift |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3295 switch Z |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3296 case 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3297 cycle_shift += 4 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3298 default |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3299 cycle_shift += 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3300 end |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3301 cycles cycle_shift |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3302 #TODO: should this happen before or after the majority of the rotate? |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3303 m68k_prefetch |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3304 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3305 1110010111MMMRRR roxl_ea |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3306 invalid M 0 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3307 invalid M 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3308 invalid M 7 R 2 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3309 invalid M 7 R 3 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3310 invalid M 7 R 4 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3311 invalid M 7 R 5 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3312 invalid M 7 R 6 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3313 invalid M 7 R 7 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3314 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3315 m68k_fetch_dst_ea M R 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3316 rlc dst 1 dst 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3317 update_flags XNZV0C |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3318 m68k_save_dst 1 |
5f725429d08f
WIP changes to new CPU core for rotate instructions and to get interrupts more functional
Michael Pavone <pavone@retrodev.com>
parents:
2562
diff
changeset
|
3319 m68k_prefetch |