summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/sharc/sharcops.h
blob: 77f1a400074096134ea0728054fa665984bb69a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
typedef struct
{
	UINT32 op_mask;
	UINT32 op_bits;
	void (* handler)(void);
} SHARC_OP;

static SHARC_OP sharc_opcode_table[] =
{
	//  |0 0 1|
	{	0xe000,		0x2000,		sharcop_compute_dreg_dm_dreg_pm						},

	//  |0 0 0|0 0 0 0 1|
	{	0xff00,		0x0100,		sharcop_compute										},

	//  |0 1 0|0|
	{	0xf000,		0x4000,		sharcop_compute_ureg_dmpm_premod					},

	//  |0 1 0|1|
	{	0xf000,		0x5000,		sharcop_compute_ureg_dmpm_postmod					},

	//  |0 1 1|0|x x x|0|0|
	{	0xf180,		0x6000,		sharcop_compute_dm_to_dreg_immmod					},

	//  |0 1 1|0|x x x|0|1|
	{	0xf180,		0x6080,		sharcop_compute_dreg_to_dm_immmod					},

	//  |0 1 1|0|x x x|1|0|
	{	0xf180,		0x6100,		sharcop_compute_pm_to_dreg_immmod					},

	//  |0 1 1|0|x x x|1|1|
	{	0xf180,		0x6180,		sharcop_compute_dreg_to_pm_immmod					},

	//  |0 1 1|1|
	{	0xf000,		0x7000,		sharcop_compute_ureg_to_ureg						},

	//  |1 0 0|0|
	{	0xf000,		0x8000,		sharcop_imm_shift_dreg_dmpm							},

	//  |0 0 0|0 0 0 1 0|
	{	0xff00,		0x0200,		sharcop_imm_shift									},

	//  |0 0 0|0 0 1 0 0|
	{	0xff00,		0x0400,		sharcop_compute_modify								},

	//  |0 0 0|0 0 1 1 0|0|
	{	0xff80,		0x0600,		sharcop_direct_jump									},

	//  |0 0 0|0 0 1 1 0|1|
	{	0xff80,		0x0680,		sharcop_direct_call									},

	//  |0 0 0|0 0 1 1 1|0|
	{	0xff80,		0x0700,		sharcop_relative_jump								},

	//  |0 0 0|0 0 1 1 1|1|
	{	0xff80,		0x0780,		sharcop_relative_call								},

	//  |0 0 0|0 1 0 0 0|0|
	{	0xff80,		0x0800,		sharcop_indirect_jump								},

	//  |0 0 0|0 1 0 0 0|1|
	{	0xff80,		0x0880,		sharcop_indirect_call								},

	//  |0 0 0|0 1 0 0 1|0|
	{	0xff80,		0x0900,		sharcop_relative_jump_compute						},

	//  |0 0 0|0 1 0 0 1|1|
	{	0xff80,		0x0980,		sharcop_relative_call_compute						},

	//  |1 1 0|
	{	0xe000,		0xc000,		sharcop_indirect_jump_compute_dreg_dm				},

	//  |1 1 1|
	{	0xe000,		0xe000,		sharcop_relative_jump_compute_dreg_dm				},

	//  |0 0 0|0 1 0 1 0|
	{	0xff00,		0x0a00,		sharcop_rts											},

	//  |0 0 0|0 1 0 1 1|
	{	0xff00,		0x0b00,		sharcop_rti											},

	//  |0 0 0|0 1 1 0 0|
	{	0xff00,		0x0c00,		sharcop_do_until_counter_imm						},

	//  |0 0 0|0 1 1 0 1|
	{	0xff00,		0x0d00,		sharcop_do_until_counter_ureg						},

	//  |0 0 0|0 1 1 1 0|
	{	0xff00,		0x0e00,		sharcop_do_until									},

	//  |0 0 0|1 0 0|0|0|
	{	0xff00,		0x1000,		sharcop_dm_to_ureg_direct							},

	//  |0 0 0|1 0 0|0|1|
	{	0xff00,		0x1100,		sharcop_ureg_to_dm_direct							},

	//  |0 0 0|1 0 0|1|0|
	{	0xff00,		0x1200,		sharcop_pm_to_ureg_direct							},

	//  |0 0 0|1 0 0|1|1|
	{	0xff00,		0x1300,		sharcop_ureg_to_pm_direct							},

	//  |1 0 1|0|x x x|0|
	{	0xf100,		0xa000,		sharcop_dm_to_ureg_indirect							},

	//  |1 0 1|0|x x x|1|
	{	0xf100,		0xa100,		sharcop_ureg_to_dm_indirect							},

	//  |1 0 1|1|x x x|0|
	{	0xf100,		0xb000,		sharcop_pm_to_ureg_indirect							},

	//  |1 0 1|1|x x x|1|
	{	0xf100,		0xb100,		sharcop_ureg_to_pm_indirect							},

	//  |1 0 0|1|
	{	0xf000,		0x9000,		sharcop_imm_to_dmpm									},

	//  |0 0 0|0 1 1 1 1|
	{	0xff00,		0x0f00,		sharcop_imm_to_ureg									},

	//  |0 0 0|1 0 1 0 0|
	{	0xff00,		0x1400,		sharcop_sysreg_bitop								},

	//  |0 0 0|1 0 1 1 0|0|
	{	0xff80,		0x1600,		sharcop_modify										},

	//  |0 0 0|1 0 1 1 0|1|
	{	0xff80,		0x1680,		sharcop_bit_reverse									},

	//  |0 0 0|1 0 1 1 1|
	{	0xff00,		0x1700,		sharcop_push_pop_stacks								},

	//  |0 0 0|0 0 0 0 0|0|
	{	0xff80,		0x0000,		sharcop_nop											},

	//  |0 0 0|0 0 0 0 0|1|
	{	0xff80,		0x0080,		sharcop_idle										},
};