sopcodes.h
2.79 KB
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
/**************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
*************************************************************************/
// $Id: sopcodes.h,v 1.1 2002/05/21 23:55:44 berndt Exp $
/*
* OPCODES
*/
`define SPECIAL opc=='h00
`define REGIMM opc=='h01
`define J opc=='h02
`define JAL opc=='h03
`define BEQ opc=='h04
`define BNE opc=='h05
`define BLEZ opc=='h06
`define BGTZ opc=='h07
`define ADDI opc=='h08
`define ADDIU opc=='h09
`define SLTI opc=='h0a
`define SLTIU opc=='h0b
`define ANDI opc=='h0c
`define ORI opc=='h0d
`define XORI opc=='h0e
`define LUI opc=='h0f
`define COP0 opc=='h10
`define COP2 opc=='h12
`define LB opc=='h20
`define LBU opc=='h24
`define LH opc=='h21
`define LHU opc=='h25
`define LW opc=='h23
`define SB opc=='h28
`define SH opc=='h29
`define SW opc=='h2b
`define LWC2 opc=='h32
`define SWC2 opc=='h3a
/*
* SPECIAL functions:
*/
`define SLL func=='h00
`define SRL func=='h02
`define SRA func=='h03
`define SLLV func=='h04
`define SRLV func=='h06
`define SRAV func=='h07
`define JR func=='h08
`define JALR func=='h09
`define BREAK func=='h0d
`define ADD func=='h20
`define ADDU func=='h21
`define SUB func=='h22
`define SUBU func=='h23
`define AND func=='h24
`define OR func=='h25
`define XOR func=='h26
`define NOR func=='h27
`define SLT func=='h2a
`define SLTU func=='h2b
/*
* REGIMM instructions:
*/
`define BLTZ rt=='h00
`define BGEZ rt=='h01
`define BLTZAL rt=='h10
`define BGEZAL rt=='h11
/*
* COP coprocessor instructions: (these are still SU instructions)
*/
`define MFC rs=='h00
`define CFC rs=='h02
`define MTC rs=='h04
`define CTC rs=='h06
/*
* VU Load and Store sub-opcodes.
* LWC2/SWC2 ...
*/
`define LSB lsopc=='h00
`define LSS lsopc=='h01
`define LSL lsopc=='h02
`define LSD lsopc=='h03
`define LSQ lsopc=='h04
`define LSP lsopc=='h05
`define LSU lsopc=='h06
`define LSH lsopc=='h07
`define LSF lsopc=='h08
`define LSA lsopc=='h09
`define LSBE lsopc=='h10
`define LSSE lsopc=='h11
`define LSLE lsopc=='h12
`define LSDE lsopc=='h13
`define LSQE lsopc=='h14
`define LSPE lsopc=='h15
`define LSUE lsopc=='h16
`define LSHE lsopc=='h17
`define LSFE lsopc=='h18
`define LSAE lsopc=='h19