2013-11-01 00:01:07 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: GPL - See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS Virtual DOS Machine
|
2015-09-18 17:01:49 +00:00
|
|
|
* FILE: subsystems/mvdm/ntvdm/cpu/bop.c
|
2013-11-01 00:01:07 +00:00
|
|
|
* PURPOSE: BIOS Operation Handlers
|
|
|
|
* PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
|
|
|
|
* Hermes Belusca-Maito (hermes.belusca@sfr.fr)
|
|
|
|
*/
|
|
|
|
|
2015-10-04 11:49:28 +00:00
|
|
|
/* INCLUDES *******************************************************************/
|
|
|
|
|
2015-10-03 19:17:55 +00:00
|
|
|
#include "ntvdm.h"
|
|
|
|
|
2014-10-02 00:03:55 +00:00
|
|
|
#define NDEBUG
|
2015-10-03 19:17:55 +00:00
|
|
|
#include <debug.h>
|
2013-11-01 00:01:07 +00:00
|
|
|
|
2015-10-04 11:49:28 +00:00
|
|
|
#include "emulator.h"
|
|
|
|
#include "bop.h"
|
|
|
|
|
2013-11-09 23:01:11 +00:00
|
|
|
/* PRIVATE VARIABLES **********************************************************/
|
2013-11-01 00:01:07 +00:00
|
|
|
|
2013-11-09 22:15:40 +00:00
|
|
|
/*
|
|
|
|
* This is the list of registered BOP handlers.
|
|
|
|
*/
|
2014-05-19 01:12:25 +00:00
|
|
|
static EMULATOR_BOP_PROC BopProc[EMULATOR_MAX_BOP_NUM] = { NULL };
|
2013-11-01 02:28:47 +00:00
|
|
|
|
2013-11-09 23:01:11 +00:00
|
|
|
/* PUBLIC FUNCTIONS ***********************************************************/
|
2013-11-01 00:01:07 +00:00
|
|
|
|
2013-12-23 18:04:32 +00:00
|
|
|
VOID RegisterBop(BYTE BopCode, EMULATOR_BOP_PROC BopHandler)
|
2013-11-01 00:01:07 +00:00
|
|
|
{
|
2013-12-15 16:30:28 +00:00
|
|
|
BopProc[BopCode] = BopHandler;
|
2013-11-09 22:15:40 +00:00
|
|
|
}
|
|
|
|
|
2015-06-12 03:30:40 +00:00
|
|
|
VOID FASTCALL EmulatorBiosOperation(PFAST486_STATE State, UCHAR BopCode)
|
2013-11-09 22:15:40 +00:00
|
|
|
{
|
|
|
|
WORD StackSegment, StackPointer;
|
|
|
|
LPWORD Stack;
|
|
|
|
|
|
|
|
/* Get the SS:SP */
|
|
|
|
StackSegment = State->SegmentRegs[FAST486_REG_SS].Selector;
|
|
|
|
StackPointer = State->GeneralRegs[FAST486_REG_ESP].LowWord;
|
|
|
|
|
|
|
|
/* Get the stack */
|
|
|
|
Stack = (LPWORD)SEG_OFF_TO_PTR(StackSegment, StackPointer);
|
|
|
|
|
|
|
|
/* Call the BOP handler */
|
|
|
|
if (BopProc[BopCode] != NULL)
|
|
|
|
BopProc[BopCode](Stack);
|
|
|
|
else
|
2014-10-02 00:03:55 +00:00
|
|
|
DPRINT1("Invalid BOP code: 0x%02X\n", BopCode);
|
2013-11-01 00:01:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|