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-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-08-24 11:48:38 +00:00
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodePrefix
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
2013-08-24 21:32:45 +00:00
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeIncrement
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeDecrement
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
2013-08-25 12:17:24 +00:00
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodePushReg
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodePopReg
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
2013-08-25 14:53:58 +00:00
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeNop
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeExchangeEax
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
2013-08-28 17:52:21 +00:00
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeShortConditionalJmp
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
2013-08-29 17:48:32 +00:00
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeClearCarry
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeSetCarry
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
2013-08-29 22:18:28 +00:00
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeComplCarry
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
2013-08-29 17:48:32 +00:00
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeClearInt
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeSetInt
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeClearDir
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeSetDir
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
2013-08-29 22:11:33 +00:00
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeHalt
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
2013-08-31 02:13:58 +00:00
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeInByte
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeIn
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeOutByte
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeOut
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
2013-08-31 21:23:31 +00:00
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeShortJump
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
2013-09-01 16:19:29 +00:00
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeMovRegImm
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
2013-09-01 17:54:51 +00:00
|
|
|
BOOLEAN
|
|
|
|
FASTCALL
|
|
|
|
Soft386OpcodeMovByteRegImm
|
|
|
|
(
|
|
|
|
PSOFT386_STATE State,
|
|
|
|
UCHAR Opcode
|
|
|
|
);
|
|
|
|
|
2013-08-22 22:54:59 +00:00
|
|
|
#endif // _OPCODES_H_
|