ReactOS 0.4.16-dev-336-gb667d82
bop.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: subsystems/mvdm/ntvdm/cpu/bop.c
5 * PURPOSE: BIOS Operation Handlers
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10/* INCLUDES *******************************************************************/
11
12#include "ntvdm.h"
13
14#define NDEBUG
15#include <debug.h>
16
17#include "emulator.h"
18#include "bop.h"
19
20/* PRIVATE VARIABLES **********************************************************/
21
22/*
23 * This is the list of registered BOP handlers.
24 */
26
27/* PUBLIC FUNCTIONS ***********************************************************/
28
30{
31 BopProc[BopCode] = BopHandler;
32}
33
35{
36 WORD StackSegment, StackPointer;
38
39 /* Get the SS:SP */
40 StackSegment = State->SegmentRegs[FAST486_REG_SS].Selector;
41 StackPointer = State->GeneralRegs[FAST486_REG_ESP].LowWord;
42
43 /* Get the stack */
44 Stack = (LPWORD)SEG_OFF_TO_PTR(StackSegment, StackPointer);
45
46 /* Call the BOP handler */
47 if (BopProc[BopCode] != NULL)
48 BopProc[BopCode](Stack);
49 else
50 DPRINT1("Invalid BOP code: 0x%02X\n", BopCode);
51}
52
53/* EOF */
#define DPRINT1
Definition: precomp.h:8
static EMULATOR_BOP_PROC BopProc[EMULATOR_MAX_BOP_NUM]
Definition: bop.c:25
VOID FASTCALL EmulatorBiosOperation(PFAST486_STATE State, UCHAR BopCode)
Definition: bop.c:34
VOID RegisterBop(BYTE BopCode, EMULATOR_BOP_PROC BopHandler)
Definition: bop.c:29
#define EMULATOR_MAX_BOP_NUM
Definition: bop.h:17
VOID(WINAPI * EMULATOR_BOP_PROC)(LPWORD Stack)
Definition: bop.h:21
#define NULL
Definition: types.h:112
#define SEG_OFF_TO_PTR(seg, off)
Definition: emulator.h:32
unsigned short WORD
Definition: ntddk_ex.h:93
#define FASTCALL
Definition: nt_native.h:50
uint16_t * LPWORD
Definition: typedefs.h:56
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
unsigned char UCHAR
Definition: xmlstorage.h:181
unsigned char BYTE
Definition: xxhash.c:193