ReactOS  0.4.14-dev-98-gb0d4763
opcodes.h
Go to the documentation of this file.
1 /*
2  * Fast486 386/486 CPU Emulation Library
3  * opcodes.h
4  *
5  * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef _OPCODES_H_
23 #define _OPCODES_H_
24 
25 #pragma once
26 
27 /* DEFINES ********************************************************************/
28 
29 #define FAST486_NUM_OPCODE_HANDLERS 256
30 #define FAST486_OPCODE_WRITE_REG (1 << 1)
31 #define FAST486_OPCODE_HANDLER(x) \
32  VOID FASTCALL x(PFAST486_STATE State, UCHAR Opcode)
33 
34 typedef VOID (FASTCALL *FAST486_OPCODE_HANDLER_PROC)(PFAST486_STATE, UCHAR);
35 
36 extern
39 
40 FAST486_OPCODE_HANDLER(Fast486OpcodeInvalid);
41 
42 FAST486_OPCODE_HANDLER(Fast486OpcodePrefix);
43 FAST486_OPCODE_HANDLER(Fast486OpcodeIncrement);
44 FAST486_OPCODE_HANDLER(Fast486OpcodeDecrement);
45 FAST486_OPCODE_HANDLER(Fast486OpcodePushReg);
46 FAST486_OPCODE_HANDLER(Fast486OpcodePopReg);
47 FAST486_OPCODE_HANDLER(Fast486OpcodeNop);
48 FAST486_OPCODE_HANDLER(Fast486OpcodeExchangeEax);
49 FAST486_OPCODE_HANDLER(Fast486OpcodeShortConditionalJmp);
50 FAST486_OPCODE_HANDLER(Fast486OpcodeClearCarry);
51 FAST486_OPCODE_HANDLER(Fast486OpcodeSetCarry);
52 FAST486_OPCODE_HANDLER(Fast486OpcodeComplCarry);
53 FAST486_OPCODE_HANDLER(Fast486OpcodeClearInt);
54 FAST486_OPCODE_HANDLER(Fast486OpcodeSetInt);
55 FAST486_OPCODE_HANDLER(Fast486OpcodeClearDir);
56 FAST486_OPCODE_HANDLER(Fast486OpcodeSetDir);
57 FAST486_OPCODE_HANDLER(Fast486OpcodeHalt);
58 FAST486_OPCODE_HANDLER(Fast486OpcodeInByte);
59 FAST486_OPCODE_HANDLER(Fast486OpcodeIn);
60 FAST486_OPCODE_HANDLER(Fast486OpcodeOutByte);
61 FAST486_OPCODE_HANDLER(Fast486OpcodeOut);
62 FAST486_OPCODE_HANDLER(Fast486OpcodeShortJump);
63 FAST486_OPCODE_HANDLER(Fast486OpcodeMovRegImm);
64 FAST486_OPCODE_HANDLER(Fast486OpcodeMovByteRegImm);
65 FAST486_OPCODE_HANDLER(Fast486OpcodeAddByteModrm);
66 FAST486_OPCODE_HANDLER(Fast486OpcodeAddModrm);
67 FAST486_OPCODE_HANDLER(Fast486OpcodeAddAl);
68 FAST486_OPCODE_HANDLER(Fast486OpcodeAddEax);
69 FAST486_OPCODE_HANDLER(Fast486OpcodeOrByteModrm);
70 FAST486_OPCODE_HANDLER(Fast486OpcodeOrModrm);
71 FAST486_OPCODE_HANDLER(Fast486OpcodeOrAl);
72 FAST486_OPCODE_HANDLER(Fast486OpcodeOrEax);
73 FAST486_OPCODE_HANDLER(Fast486OpcodeAndByteModrm);
74 FAST486_OPCODE_HANDLER(Fast486OpcodeAndModrm);
75 FAST486_OPCODE_HANDLER(Fast486OpcodeAndAl);
76 FAST486_OPCODE_HANDLER(Fast486OpcodeAndEax);
77 FAST486_OPCODE_HANDLER(Fast486OpcodeXorByteModrm);
78 FAST486_OPCODE_HANDLER(Fast486OpcodeXorModrm);
79 FAST486_OPCODE_HANDLER(Fast486OpcodeXorAl);
80 FAST486_OPCODE_HANDLER(Fast486OpcodeXorEax);
81 FAST486_OPCODE_HANDLER(Fast486OpcodeTestByteModrm);
82 FAST486_OPCODE_HANDLER(Fast486OpcodeTestModrm);
83 FAST486_OPCODE_HANDLER(Fast486OpcodeTestAl);
84 FAST486_OPCODE_HANDLER(Fast486OpcodeTestEax);
85 FAST486_OPCODE_HANDLER(Fast486OpcodeXchgByteModrm);
86 FAST486_OPCODE_HANDLER(Fast486OpcodeXchgModrm);
87 FAST486_OPCODE_HANDLER(Fast486OpcodePushEs);
88 FAST486_OPCODE_HANDLER(Fast486OpcodePopEs);
89 FAST486_OPCODE_HANDLER(Fast486OpcodePushCs);
90 FAST486_OPCODE_HANDLER(Fast486OpcodeAdcByteModrm);
91 FAST486_OPCODE_HANDLER(Fast486OpcodeAdcModrm);
92 FAST486_OPCODE_HANDLER(Fast486OpcodeAdcAl);
93 FAST486_OPCODE_HANDLER(Fast486OpcodeAdcEax);
94 FAST486_OPCODE_HANDLER(Fast486OpcodePushSs);
95 FAST486_OPCODE_HANDLER(Fast486OpcodePopSs);
96 FAST486_OPCODE_HANDLER(Fast486OpcodeSbbByteModrm);
97 FAST486_OPCODE_HANDLER(Fast486OpcodeSbbModrm);
98 FAST486_OPCODE_HANDLER(Fast486OpcodeSbbAl);
99 FAST486_OPCODE_HANDLER(Fast486OpcodeSbbEax);
100 FAST486_OPCODE_HANDLER(Fast486OpcodePushDs);
101 FAST486_OPCODE_HANDLER(Fast486OpcodePopDs);
102 FAST486_OPCODE_HANDLER(Fast486OpcodeDaa);
103 FAST486_OPCODE_HANDLER(Fast486OpcodeCmpSubByteModrm);
104 FAST486_OPCODE_HANDLER(Fast486OpcodeCmpSubModrm);
105 FAST486_OPCODE_HANDLER(Fast486OpcodeCmpSubAl);
106 FAST486_OPCODE_HANDLER(Fast486OpcodeCmpSubEax);
107 FAST486_OPCODE_HANDLER(Fast486OpcodeDas);
108 FAST486_OPCODE_HANDLER(Fast486OpcodeAaa);
109 FAST486_OPCODE_HANDLER(Fast486OpcodeAas);
110 FAST486_OPCODE_HANDLER(Fast486OpcodePushAll);
111 FAST486_OPCODE_HANDLER(Fast486OpcodePopAll);
112 FAST486_OPCODE_HANDLER(Fast486OpcodeBound);
113 FAST486_OPCODE_HANDLER(Fast486OpcodeArpl);
114 FAST486_OPCODE_HANDLER(Fast486OpcodePushImm);
115 FAST486_OPCODE_HANDLER(Fast486OpcodeImulModrmImm);
116 FAST486_OPCODE_HANDLER(Fast486OpcodePushByteImm);
117 FAST486_OPCODE_HANDLER(Fast486OpcodeMovByteModrm);
118 FAST486_OPCODE_HANDLER(Fast486OpcodeMovModrm);
119 FAST486_OPCODE_HANDLER(Fast486OpcodeMovStoreSeg);
120 FAST486_OPCODE_HANDLER(Fast486OpcodeLea);
121 FAST486_OPCODE_HANDLER(Fast486OpcodeMovLoadSeg);
122 FAST486_OPCODE_HANDLER(Fast486OpcodeCwde);
123 FAST486_OPCODE_HANDLER(Fast486OpcodeCdq);
124 FAST486_OPCODE_HANDLER(Fast486OpcodeCallAbs);
125 FAST486_OPCODE_HANDLER(Fast486OpcodeWait);
126 FAST486_OPCODE_HANDLER(Fast486OpcodePushFlags);
127 FAST486_OPCODE_HANDLER(Fast486OpcodePopFlags);
128 FAST486_OPCODE_HANDLER(Fast486OpcodeSahf);
129 FAST486_OPCODE_HANDLER(Fast486OpcodeLahf);
130 FAST486_OPCODE_HANDLER(Fast486OpcodeRet);
131 FAST486_OPCODE_HANDLER(Fast486OpcodeLdsLes);
132 FAST486_OPCODE_HANDLER(Fast486OpcodeEnter);
133 FAST486_OPCODE_HANDLER(Fast486OpcodeLeave);
134 FAST486_OPCODE_HANDLER(Fast486OpcodeRetFarImm);
135 FAST486_OPCODE_HANDLER(Fast486OpcodeRetFar);
136 FAST486_OPCODE_HANDLER(Fast486OpcodeInt);
137 FAST486_OPCODE_HANDLER(Fast486OpcodeIret);
138 FAST486_OPCODE_HANDLER(Fast486OpcodeAam);
139 FAST486_OPCODE_HANDLER(Fast486OpcodeAad);
140 FAST486_OPCODE_HANDLER(Fast486OpcodeXlat);
141 FAST486_OPCODE_HANDLER(Fast486OpcodeLoop);
142 FAST486_OPCODE_HANDLER(Fast486OpcodeJecxz);
143 FAST486_OPCODE_HANDLER(Fast486OpcodeCall);
144 FAST486_OPCODE_HANDLER(Fast486OpcodeJmp);
145 FAST486_OPCODE_HANDLER(Fast486OpcodeJmpAbs);
146 FAST486_OPCODE_HANDLER(Fast486OpcodeMovAlOffset);
147 FAST486_OPCODE_HANDLER(Fast486OpcodeMovEaxOffset);
148 FAST486_OPCODE_HANDLER(Fast486OpcodeMovOffsetAl);
149 FAST486_OPCODE_HANDLER(Fast486OpcodeMovOffsetEax);
150 FAST486_OPCODE_HANDLER(Fast486OpcodeSalc);
151 FAST486_OPCODE_HANDLER(Fast486OpcodeMovs);
152 FAST486_OPCODE_HANDLER(Fast486OpcodeCmps);
153 FAST486_OPCODE_HANDLER(Fast486OpcodeStos);
154 FAST486_OPCODE_HANDLER(Fast486OpcodeLods);
155 FAST486_OPCODE_HANDLER(Fast486OpcodeScas);
156 FAST486_OPCODE_HANDLER(Fast486OpcodeIns);
157 FAST486_OPCODE_HANDLER(Fast486OpcodeOuts);
158 
159 #endif // _OPCODES_H_
160 
161 /* EOF */
FAST486_OPCODE_HANDLER_PROC Fast486OpcodeHandlers[FAST486_NUM_OPCODE_HANDLERS]
Definition: opcodes.c:39
#define FASTCALL
Definition: nt_native.h:50
#define FAST486_NUM_OPCODE_HANDLERS
Definition: opcodes.h:29
#define FAST486_OPCODE_HANDLER(x)
Definition: opcodes.h:31
unsigned char UCHAR
Definition: xmlstorage.h:181
#define VOID
Definition: acefi.h:82
VOID(FASTCALL * FAST486_OPCODE_HANDLER_PROC)(PFAST486_STATE, UCHAR)
Definition: opcodes.h:34