tac0S
Template Affectional Command Operating System
encode.h
1 /*
2  Copyright (c) 1992-1993 The Regents of the University of California.
3  All rights reserved. See copyright.h for copyright notice and limitation
4  of liability and disclaimer of warranty provisions.
5  */
6 
7 #include "copyright.h"
8 
9 
10 /* normal opcodes */
11 
12 #define I_SPECIAL 000
13 #define I_BCOND 001
14 #define I_J 002
15 #define I_JAL 003
16 #define I_BEQ 004
17 #define I_BNE 005
18 #define I_BLEZ 006
19 #define I_BGTZ 007
20 #define I_ADDI 010
21 #define I_ADDIU 011
22 #define I_SLTI 012
23 #define I_SLTIU 013
24 #define I_ANDI 014
25 #define I_ORI 015
26 #define I_XORI 016
27 #define I_LUI 017
28 #define I_COP0 020
29 #define I_COP1 021
30 #define I_COP2 022
31 #define I_COP3 023
32 
33 #define I_LB 040
34 #define I_LH 041
35 #define I_LWL 042
36 #define I_LW 043
37 #define I_LBU 044
38 #define I_LHU 045
39 #define I_LWR 046
40 
41 #define I_SB 050
42 #define I_SH 051
43 #define I_SWL 052
44 #define I_SW 053
45 
46 #define I_SWR 056
47 
48 #define I_LWC0 060
49 #define I_LWC1 061
50 #define I_LWC2 062
51 #define I_LWC3 063
52 
53 #define I_SWC0 070
54 #define I_SWC1 071
55 #define I_SWC2 072
56 #define I_SWC3 073
57 
58 /* special opcodes */
59 
60 #define I_SLL 000
61 
62 #define I_SRL 002
63 #define I_SRA 003
64 #define I_SLLV 004
65 
66 #define I_SRLV 006
67 #define I_SRAV 007
68 #define I_JR 010
69 #define I_JALR 011
70 
71 #define I_SYSCALL 014
72 #define I_BREAK 015
73 
74 #define I_MFHI 020
75 #define I_MTHI 021
76 #define I_MFLO 022
77 #define I_MTLO 023
78 
79 #define I_MULT 030
80 #define I_MULTU 031
81 #define I_DIV 032
82 #define I_DIVU 033
83 
84 #define I_ADD 040
85 #define I_ADDU 041
86 #define I_SUB 042
87 #define I_SUBU 043
88 #define I_AND 044
89 #define I_OR 045
90 #define I_XOR 046
91 #define I_NOR 047
92 
93 #define I_SLT 052
94 #define I_SLTU 053
95 
96 /* bcond opcodes */
97 
98 
99 #define I_BLTZ 000
100 #define I_BGEZ 001
101 
102 #define I_BLTZAL 020
103 #define I_BGEZAL 021
104 
105 /* whole instructions */
106 
107 #define I_NOP 000