[SOFT386]
[reactos.git] / lib / soft386 / opcodes.h
1 /*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: 386/486 CPU Emulation Library
4 * FILE: opcodes.h
5 * PURPOSE: Opcode handlers. (header file)
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 */
8
9 #ifndef _OPCODES_H_
10 #define _OPCODES_H_
11
12 /* DEFINES ********************************************************************/
13
14 #ifndef FASTCALL
15 #define FASTCALL __fastcall
16 #endif
17
18 #define SOFT386_NUM_OPCODE_HANDLERS 256
19 #define SOFT386_OPCODE_WRITE_REG (1 << 1)
20 #define SOFT386_OPCODE_HANDLER(x) \
21 BOOLEAN FASTCALL x(PSOFT386_STATE State, UCHAR Opcode)
22
23 typedef BOOLEAN (FASTCALL *SOFT386_OPCODE_HANDLER_PROC)(PSOFT386_STATE, UCHAR);
24
25 extern
26 SOFT386_OPCODE_HANDLER_PROC
27 Soft386OpcodeHandlers[SOFT386_NUM_OPCODE_HANDLERS];
28
29 SOFT386_OPCODE_HANDLER(Soft386OpcodePrefix);
30 SOFT386_OPCODE_HANDLER(Soft386OpcodeIncrement);
31 SOFT386_OPCODE_HANDLER(Soft386OpcodeDecrement);
32 SOFT386_OPCODE_HANDLER(Soft386OpcodePushReg);
33 SOFT386_OPCODE_HANDLER(Soft386OpcodePopReg);
34 SOFT386_OPCODE_HANDLER(Soft386OpcodeNop);
35 SOFT386_OPCODE_HANDLER(Soft386OpcodeExchangeEax);
36 SOFT386_OPCODE_HANDLER(Soft386OpcodeShortConditionalJmp);
37 SOFT386_OPCODE_HANDLER(Soft386OpcodeClearCarry);
38 SOFT386_OPCODE_HANDLER(Soft386OpcodeSetCarry);
39 SOFT386_OPCODE_HANDLER(Soft386OpcodeComplCarry);
40 SOFT386_OPCODE_HANDLER(Soft386OpcodeClearInt);
41 SOFT386_OPCODE_HANDLER(Soft386OpcodeSetInt);
42 SOFT386_OPCODE_HANDLER(Soft386OpcodeClearDir);
43 SOFT386_OPCODE_HANDLER(Soft386OpcodeSetDir);
44 SOFT386_OPCODE_HANDLER(Soft386OpcodeHalt);
45 SOFT386_OPCODE_HANDLER(Soft386OpcodeInByte);
46 SOFT386_OPCODE_HANDLER(Soft386OpcodeIn);
47 SOFT386_OPCODE_HANDLER(Soft386OpcodeOutByte);
48 SOFT386_OPCODE_HANDLER(Soft386OpcodeOut);
49 SOFT386_OPCODE_HANDLER(Soft386OpcodeShortJump);
50 SOFT386_OPCODE_HANDLER(Soft386OpcodeMovRegImm);
51 SOFT386_OPCODE_HANDLER(Soft386OpcodeMovByteRegImm);
52 SOFT386_OPCODE_HANDLER(Soft386OpcodeAddByteModrm);
53 SOFT386_OPCODE_HANDLER(Soft386OpcodeAddModrm);
54 SOFT386_OPCODE_HANDLER(Soft386OpcodeAddAl);
55 SOFT386_OPCODE_HANDLER(Soft386OpcodeAddEax);
56 SOFT386_OPCODE_HANDLER(Soft386OpcodeOrByteModrm);
57 SOFT386_OPCODE_HANDLER(Soft386OpcodeOrModrm);
58 SOFT386_OPCODE_HANDLER(Soft386OpcodeOrAl);
59 SOFT386_OPCODE_HANDLER(Soft386OpcodeOrEax);
60 SOFT386_OPCODE_HANDLER(Soft386OpcodeAndByteModrm);
61 SOFT386_OPCODE_HANDLER(Soft386OpcodeAndModrm);
62 SOFT386_OPCODE_HANDLER(Soft386OpcodeAndAl);
63 SOFT386_OPCODE_HANDLER(Soft386OpcodeAndEax);
64 SOFT386_OPCODE_HANDLER(Soft386OpcodeXorByteModrm);
65 SOFT386_OPCODE_HANDLER(Soft386OpcodeXorModrm);
66 SOFT386_OPCODE_HANDLER(Soft386OpcodeXorAl);
67 SOFT386_OPCODE_HANDLER(Soft386OpcodeXorEax);
68 SOFT386_OPCODE_HANDLER(Soft386OpcodeTestByteModrm);
69 SOFT386_OPCODE_HANDLER(Soft386OpcodeTestModrm);
70 SOFT386_OPCODE_HANDLER(Soft386OpcodeTestAl);
71 SOFT386_OPCODE_HANDLER(Soft386OpcodeTestEax);
72 SOFT386_OPCODE_HANDLER(Soft386OpcodeXchgByteModrm);
73 SOFT386_OPCODE_HANDLER(Soft386OpcodeXchgModrm);
74 SOFT386_OPCODE_HANDLER(Soft386OpcodePushEs);
75 SOFT386_OPCODE_HANDLER(Soft386OpcodePopEs);
76 SOFT386_OPCODE_HANDLER(Soft386OpcodePushCs);
77 SOFT386_OPCODE_HANDLER(Soft386OpcodeAdcByteModrm);
78 SOFT386_OPCODE_HANDLER(Soft386OpcodeAdcModrm);
79 SOFT386_OPCODE_HANDLER(Soft386OpcodeAdcAl);
80 SOFT386_OPCODE_HANDLER(Soft386OpcodeAdcEax);
81 SOFT386_OPCODE_HANDLER(Soft386OpcodePushSs);
82 SOFT386_OPCODE_HANDLER(Soft386OpcodePopSs);
83 SOFT386_OPCODE_HANDLER(Soft386OpcodeSbbByteModrm);
84 SOFT386_OPCODE_HANDLER(Soft386OpcodeSbbModrm);
85 SOFT386_OPCODE_HANDLER(Soft386OpcodeSbbAl);
86 SOFT386_OPCODE_HANDLER(Soft386OpcodeSbbEax);
87 SOFT386_OPCODE_HANDLER(Soft386OpcodePushDs);
88 SOFT386_OPCODE_HANDLER(Soft386OpcodePopDs);
89 SOFT386_OPCODE_HANDLER(Soft386OpcodeDaa);
90 SOFT386_OPCODE_HANDLER(Soft386OpcodeCmpSubByteModrm);
91 SOFT386_OPCODE_HANDLER(Soft386OpcodeCmpSubModrm);
92 SOFT386_OPCODE_HANDLER(Soft386OpcodeCmpSubAl);
93 SOFT386_OPCODE_HANDLER(Soft386OpcodeCmpSubEax);
94 SOFT386_OPCODE_HANDLER(Soft386OpcodeDas);
95 SOFT386_OPCODE_HANDLER(Soft386OpcodeAaa);
96 SOFT386_OPCODE_HANDLER(Soft386OpcodeAas);
97 SOFT386_OPCODE_HANDLER(Soft386OpcodePushAll);
98 SOFT386_OPCODE_HANDLER(Soft386OpcodePopAll);
99 SOFT386_OPCODE_HANDLER(Soft386OpcodeBound);
100 SOFT386_OPCODE_HANDLER(Soft386OpcodeArpl);
101 SOFT386_OPCODE_HANDLER(Soft386OpcodePushImm);
102 SOFT386_OPCODE_HANDLER(Soft386OpcodeImulModrmImm);
103 SOFT386_OPCODE_HANDLER(Soft386OpcodePushByteImm);
104 SOFT386_OPCODE_HANDLER(Soft386OpcodeImulModrmByteImm);
105 SOFT386_OPCODE_HANDLER(Soft386OpcodeMovByteModrm);
106 SOFT386_OPCODE_HANDLER(Soft386OpcodeMovModrm);
107 SOFT386_OPCODE_HANDLER(Soft386OpcodeMovStoreSeg);
108 SOFT386_OPCODE_HANDLER(Soft386OpcodeLea);
109 SOFT386_OPCODE_HANDLER(Soft386OpcodeMovLoadSeg);
110 SOFT386_OPCODE_HANDLER(Soft386OpcodeCwde);
111 SOFT386_OPCODE_HANDLER(Soft386OpcodeCdq);
112 SOFT386_OPCODE_HANDLER(Soft386OpcodeCallAbs);
113 SOFT386_OPCODE_HANDLER(Soft386OpcodeWait);
114 SOFT386_OPCODE_HANDLER(Soft386OpcodePushFlags);
115 SOFT386_OPCODE_HANDLER(Soft386OpcodePopFlags);
116 SOFT386_OPCODE_HANDLER(Soft386OpcodeSahf);
117 SOFT386_OPCODE_HANDLER(Soft386OpcodeLahf);
118 SOFT386_OPCODE_HANDLER(Soft386OpcodeRet);
119 SOFT386_OPCODE_HANDLER(Soft386OpcodeLes);
120 SOFT386_OPCODE_HANDLER(Soft386OpcodeLds);
121 SOFT386_OPCODE_HANDLER(Soft386OpcodeEnter);
122 SOFT386_OPCODE_HANDLER(Soft386OpcodeLeave);
123 SOFT386_OPCODE_HANDLER(Soft386OpcodeRetFarImm);
124 SOFT386_OPCODE_HANDLER(Soft386OpcodeRetFar);
125 SOFT386_OPCODE_HANDLER(Soft386OpcodeInt);
126 SOFT386_OPCODE_HANDLER(Soft386OpcodeIret);
127 SOFT386_OPCODE_HANDLER(Soft386OpcodeAam);
128 SOFT386_OPCODE_HANDLER(Soft386OpcodeAad);
129 SOFT386_OPCODE_HANDLER(Soft386OpcodeXlat);
130 SOFT386_OPCODE_HANDLER(Soft386OpcodeLoop);
131 SOFT386_OPCODE_HANDLER(Soft386OpcodeJecxz);
132 SOFT386_OPCODE_HANDLER(Soft386OpcodeCall);
133 SOFT386_OPCODE_HANDLER(Soft386OpcodeJmp);
134 SOFT386_OPCODE_HANDLER(Soft386OpcodeJmpAbs);
135
136 #endif // _OPCODES_H_