2013-08-22 22:54:59 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: GPL - See COPYING in the top level directory
|
|
|
|
* PROJECT: 386/486 CPU Emulation Library
|
|
|
|
* FILE: opcodes.h
|
|
|
|
* PURPOSE: Opcode handlers. (header file)
|
|
|
|
* PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _OPCODES_H_
|
|
|
|
#define _OPCODES_H_
|
|
|
|
|
|
|
|
/* DEFINES ********************************************************************/
|
|
|
|
|
2013-08-24 11:48:38 +00:00
|
|
|
#ifndef FASTCALL
|
|
|
|
#define FASTCALL __fastcall
|
|
|
|
#endif
|
|
|
|
|
2013-08-22 22:54:59 +00:00
|
|
|
#define SOFT386_NUM_OPCODE_HANDLERS 256
|
2013-09-04 01:11:12 +00:00
|
|
|
#define SOFT386_OPCODE_WRITE_REG (1 << 1)
|
2013-09-04 16:36:39 +00:00
|
|
|
#define SOFT386_OPCODE_HANDLER(x) BOOLEAN\
|
|
|
|
FASTCALL\
|
|
|
|
(x)(PSOFT386_STATE State, UCHAR Opcode)
|
2013-08-22 22:54:59 +00:00
|
|
|
|
2013-08-24 11:48:38 +00:00
|
|
|
typedef BOOLEAN (FASTCALL *SOFT386_OPCODE_HANDLER_PROC)(PSOFT386_STATE, UCHAR);
|
2013-08-22 22:54:59 +00:00
|
|
|
|
|
|
|
extern
|
|
|
|
SOFT386_OPCODE_HANDLER_PROC
|
|
|
|
Soft386OpcodeHandlers[SOFT386_NUM_OPCODE_HANDLERS];
|
|
|
|
|
2013-09-04 16:36:39 +00:00
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodePrefix);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeIncrement);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeDecrement);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodePushReg);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodePopReg);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeNop);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeExchangeEax);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeShortConditionalJmp);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeClearCarry);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeSetCarry);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeComplCarry);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeClearInt);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeSetInt);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeClearDir);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeSetDir);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeHalt);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeInByte);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeIn);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeOutByte);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeOut);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeShortJump);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeMovRegImm);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeMovByteRegImm);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeAddByteModrm);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeAddModrm);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeAddAl);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeAddEax);
|
2013-09-04 18:28:58 +00:00
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeOrByteModrm);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeOrModrm);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeOrAl);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeOrEax);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeAndByteModrm);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeAndModrm);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeAndAl);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeAndEax);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeXorByteModrm);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeXorModrm);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeXorAl);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeXorEax);
|
2013-09-05 23:48:07 +00:00
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeTestByteModrm);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeTestModrm);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeXchgByteModrm);
|
|
|
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeXchgModrm);
|
2013-09-04 01:11:12 +00:00
|
|
|
|
2013-08-22 22:54:59 +00:00
|
|
|
#endif // _OPCODES_H_
|