ReactOS 0.4.15-dev-8096-ga0eec98
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
34typedef VOID (FASTCALL *FAST486_OPCODE_HANDLER_PROC)(PFAST486_STATE, UCHAR);
35
36extern
39
40FAST486_OPCODE_HANDLER(Fast486OpcodeInvalid);
41
42FAST486_OPCODE_HANDLER(Fast486OpcodePrefix);
43FAST486_OPCODE_HANDLER(Fast486OpcodeIncrement);
44FAST486_OPCODE_HANDLER(Fast486OpcodeDecrement);
45FAST486_OPCODE_HANDLER(Fast486OpcodePushReg);
46FAST486_OPCODE_HANDLER(Fast486OpcodePopReg);
47FAST486_OPCODE_HANDLER(Fast486OpcodeNop);
48FAST486_OPCODE_HANDLER(Fast486OpcodeExchangeEax);
49FAST486_OPCODE_HANDLER(Fast486OpcodeShortConditionalJmp);
50FAST486_OPCODE_HANDLER(Fast486OpcodeClearCarry);
51FAST486_OPCODE_HANDLER(Fast486OpcodeSetCarry);
52FAST486_OPCODE_HANDLER(Fast486OpcodeComplCarry);
53FAST486_OPCODE_HANDLER(Fast486OpcodeClearInt);
54FAST486_OPCODE_HANDLER(Fast486OpcodeSetInt);
55FAST486_OPCODE_HANDLER(Fast486OpcodeClearDir);
56FAST486_OPCODE_HANDLER(Fast486OpcodeSetDir);
57FAST486_OPCODE_HANDLER(Fast486OpcodeHalt);
58FAST486_OPCODE_HANDLER(Fast486OpcodeInByte);
59FAST486_OPCODE_HANDLER(Fast486OpcodeIn);
60FAST486_OPCODE_HANDLER(Fast486OpcodeOutByte);
61FAST486_OPCODE_HANDLER(Fast486OpcodeOut);
62FAST486_OPCODE_HANDLER(Fast486OpcodeShortJump);
63FAST486_OPCODE_HANDLER(Fast486OpcodeMovRegImm);
64FAST486_OPCODE_HANDLER(Fast486OpcodeMovByteRegImm);
65FAST486_OPCODE_HANDLER(Fast486OpcodeAddByteModrm);
66FAST486_OPCODE_HANDLER(Fast486OpcodeAddModrm);
67FAST486_OPCODE_HANDLER(Fast486OpcodeAddAl);
68FAST486_OPCODE_HANDLER(Fast486OpcodeAddEax);
69FAST486_OPCODE_HANDLER(Fast486OpcodeOrByteModrm);
70FAST486_OPCODE_HANDLER(Fast486OpcodeOrModrm);
71FAST486_OPCODE_HANDLER(Fast486OpcodeOrAl);
72FAST486_OPCODE_HANDLER(Fast486OpcodeOrEax);
73FAST486_OPCODE_HANDLER(Fast486OpcodeAndByteModrm);
74FAST486_OPCODE_HANDLER(Fast486OpcodeAndModrm);
75FAST486_OPCODE_HANDLER(Fast486OpcodeAndAl);
76FAST486_OPCODE_HANDLER(Fast486OpcodeAndEax);
77FAST486_OPCODE_HANDLER(Fast486OpcodeXorByteModrm);
78FAST486_OPCODE_HANDLER(Fast486OpcodeXorModrm);
79FAST486_OPCODE_HANDLER(Fast486OpcodeXorAl);
80FAST486_OPCODE_HANDLER(Fast486OpcodeXorEax);
81FAST486_OPCODE_HANDLER(Fast486OpcodeTestByteModrm);
82FAST486_OPCODE_HANDLER(Fast486OpcodeTestModrm);
83FAST486_OPCODE_HANDLER(Fast486OpcodeTestAl);
84FAST486_OPCODE_HANDLER(Fast486OpcodeTestEax);
85FAST486_OPCODE_HANDLER(Fast486OpcodeXchgByteModrm);
86FAST486_OPCODE_HANDLER(Fast486OpcodeXchgModrm);
87FAST486_OPCODE_HANDLER(Fast486OpcodePushEs);
88FAST486_OPCODE_HANDLER(Fast486OpcodePopEs);
89FAST486_OPCODE_HANDLER(Fast486OpcodePushCs);
90FAST486_OPCODE_HANDLER(Fast486OpcodeAdcByteModrm);
91FAST486_OPCODE_HANDLER(Fast486OpcodeAdcModrm);
92FAST486_OPCODE_HANDLER(Fast486OpcodeAdcAl);
93FAST486_OPCODE_HANDLER(Fast486OpcodeAdcEax);
94FAST486_OPCODE_HANDLER(Fast486OpcodePushSs);
95FAST486_OPCODE_HANDLER(Fast486OpcodePopSs);
96FAST486_OPCODE_HANDLER(Fast486OpcodeSbbByteModrm);
97FAST486_OPCODE_HANDLER(Fast486OpcodeSbbModrm);
98FAST486_OPCODE_HANDLER(Fast486OpcodeSbbAl);
99FAST486_OPCODE_HANDLER(Fast486OpcodeSbbEax);
100FAST486_OPCODE_HANDLER(Fast486OpcodePushDs);
101FAST486_OPCODE_HANDLER(Fast486OpcodePopDs);
102FAST486_OPCODE_HANDLER(Fast486OpcodeDaa);
103FAST486_OPCODE_HANDLER(Fast486OpcodeCmpSubByteModrm);
104FAST486_OPCODE_HANDLER(Fast486OpcodeCmpSubModrm);
105FAST486_OPCODE_HANDLER(Fast486OpcodeCmpSubAl);
106FAST486_OPCODE_HANDLER(Fast486OpcodeCmpSubEax);
107FAST486_OPCODE_HANDLER(Fast486OpcodeDas);
108FAST486_OPCODE_HANDLER(Fast486OpcodeAaa);
109FAST486_OPCODE_HANDLER(Fast486OpcodeAas);
110FAST486_OPCODE_HANDLER(Fast486OpcodePushAll);
111FAST486_OPCODE_HANDLER(Fast486OpcodePopAll);
112FAST486_OPCODE_HANDLER(Fast486OpcodeBound);
113FAST486_OPCODE_HANDLER(Fast486OpcodeArpl);
114FAST486_OPCODE_HANDLER(Fast486OpcodePushImm);
115FAST486_OPCODE_HANDLER(Fast486OpcodeImulModrmImm);
116FAST486_OPCODE_HANDLER(Fast486OpcodePushByteImm);
117FAST486_OPCODE_HANDLER(Fast486OpcodeMovByteModrm);
118FAST486_OPCODE_HANDLER(Fast486OpcodeMovModrm);
119FAST486_OPCODE_HANDLER(Fast486OpcodeMovStoreSeg);
120FAST486_OPCODE_HANDLER(Fast486OpcodeLea);
121FAST486_OPCODE_HANDLER(Fast486OpcodeMovLoadSeg);
122FAST486_OPCODE_HANDLER(Fast486OpcodeCwde);
123FAST486_OPCODE_HANDLER(Fast486OpcodeCdq);
124FAST486_OPCODE_HANDLER(Fast486OpcodeCallAbs);
125FAST486_OPCODE_HANDLER(Fast486OpcodeWait);
126FAST486_OPCODE_HANDLER(Fast486OpcodePushFlags);
127FAST486_OPCODE_HANDLER(Fast486OpcodePopFlags);
128FAST486_OPCODE_HANDLER(Fast486OpcodeSahf);
129FAST486_OPCODE_HANDLER(Fast486OpcodeLahf);
130FAST486_OPCODE_HANDLER(Fast486OpcodeRet);
131FAST486_OPCODE_HANDLER(Fast486OpcodeLdsLes);
132FAST486_OPCODE_HANDLER(Fast486OpcodeEnter);
133FAST486_OPCODE_HANDLER(Fast486OpcodeLeave);
134FAST486_OPCODE_HANDLER(Fast486OpcodeRetFarImm);
135FAST486_OPCODE_HANDLER(Fast486OpcodeRetFar);
136FAST486_OPCODE_HANDLER(Fast486OpcodeInt);
137FAST486_OPCODE_HANDLER(Fast486OpcodeIret);
138FAST486_OPCODE_HANDLER(Fast486OpcodeAam);
139FAST486_OPCODE_HANDLER(Fast486OpcodeAad);
140FAST486_OPCODE_HANDLER(Fast486OpcodeXlat);
141FAST486_OPCODE_HANDLER(Fast486OpcodeLoop);
142FAST486_OPCODE_HANDLER(Fast486OpcodeJecxz);
143FAST486_OPCODE_HANDLER(Fast486OpcodeCall);
144FAST486_OPCODE_HANDLER(Fast486OpcodeJmp);
145FAST486_OPCODE_HANDLER(Fast486OpcodeJmpAbs);
146FAST486_OPCODE_HANDLER(Fast486OpcodeMovAlOffset);
147FAST486_OPCODE_HANDLER(Fast486OpcodeMovEaxOffset);
148FAST486_OPCODE_HANDLER(Fast486OpcodeMovOffsetAl);
149FAST486_OPCODE_HANDLER(Fast486OpcodeMovOffsetEax);
150FAST486_OPCODE_HANDLER(Fast486OpcodeSalc);
151FAST486_OPCODE_HANDLER(Fast486OpcodeMovs);
152FAST486_OPCODE_HANDLER(Fast486OpcodeCmps);
153FAST486_OPCODE_HANDLER(Fast486OpcodeStos);
154FAST486_OPCODE_HANDLER(Fast486OpcodeLods);
155FAST486_OPCODE_HANDLER(Fast486OpcodeScas);
156FAST486_OPCODE_HANDLER(Fast486OpcodeIns);
157FAST486_OPCODE_HANDLER(Fast486OpcodeOuts);
158
159#endif // _OPCODES_H_
160
161/* EOF */
#define VOID
Definition: acefi.h:82
#define FASTCALL
Definition: nt_native.h:50
#define FAST486_NUM_OPCODE_HANDLERS
Definition: opcodes.h:29
FAST486_OPCODE_HANDLER_PROC Fast486OpcodeHandlers[FAST486_NUM_OPCODE_HANDLERS]
Definition: opcodes.c:39
VOID(FASTCALL * FAST486_OPCODE_HANDLER_PROC)(PFAST486_STATE, UCHAR)
Definition: opcodes.h:34
#define FAST486_OPCODE_HANDLER(x)
Definition: opcodes.h:31
unsigned char UCHAR
Definition: xmlstorage.h:181