ReactOS  0.4.14-dev-115-g4576127
registers.c File Reference
#include "ntvdm.h"
#include <debug.h>
#include "emulator.h"
#include "cpu.h"
#include "x86context.h"
Include dependency graph for registers.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

PVOID WINAPI getIntelRegistersPointer (VOID)
 
ULONG WINAPI getEAX (VOID)
 
VOID WINAPI setEAX (ULONG Value)
 
USHORT WINAPI getAX (VOID)
 
VOID WINAPI setAX (USHORT Value)
 
UCHAR WINAPI getAH (VOID)
 
VOID WINAPI setAH (UCHAR Value)
 
UCHAR WINAPI getAL (VOID)
 
VOID WINAPI setAL (UCHAR Value)
 
ULONG WINAPI getEBX (VOID)
 
VOID WINAPI setEBX (ULONG Value)
 
USHORT WINAPI getBX (VOID)
 
VOID WINAPI setBX (USHORT Value)
 
UCHAR WINAPI getBH (VOID)
 
VOID WINAPI setBH (UCHAR Value)
 
UCHAR WINAPI getBL (VOID)
 
VOID WINAPI setBL (UCHAR Value)
 
ULONG WINAPI getECX (VOID)
 
VOID WINAPI setECX (ULONG Value)
 
USHORT WINAPI getCX (VOID)
 
VOID WINAPI setCX (USHORT Value)
 
UCHAR WINAPI getCH (VOID)
 
VOID WINAPI setCH (UCHAR Value)
 
UCHAR WINAPI getCL (VOID)
 
VOID WINAPI setCL (UCHAR Value)
 
ULONG WINAPI getEDX (VOID)
 
VOID WINAPI setEDX (ULONG Value)
 
USHORT WINAPI getDX (VOID)
 
VOID WINAPI setDX (USHORT Value)
 
UCHAR WINAPI getDH (VOID)
 
VOID WINAPI setDH (UCHAR Value)
 
UCHAR WINAPI getDL (VOID)
 
VOID WINAPI setDL (UCHAR Value)
 
ULONG WINAPI getESP (VOID)
 
VOID WINAPI setESP (ULONG Value)
 
USHORT WINAPI getSP (VOID)
 
VOID WINAPI setSP (USHORT Value)
 
ULONG WINAPI getEBP (VOID)
 
VOID WINAPI setEBP (ULONG Value)
 
USHORT WINAPI getBP (VOID)
 
VOID WINAPI setBP (USHORT Value)
 
ULONG WINAPI getESI (VOID)
 
VOID WINAPI setESI (ULONG Value)
 
USHORT WINAPI getSI (VOID)
 
VOID WINAPI setSI (USHORT Value)
 
ULONG WINAPI getEDI (VOID)
 
VOID WINAPI setEDI (ULONG Value)
 
USHORT WINAPI getDI (VOID)
 
VOID WINAPI setDI (USHORT Value)
 
ULONG WINAPI getEIP (VOID)
 
VOID WINAPI setEIP (ULONG Value)
 
USHORT WINAPI getIP (VOID)
 
VOID WINAPI setIP (USHORT Value)
 
USHORT WINAPI getCS (VOID)
 
VOID WINAPI setCS (USHORT Value)
 
USHORT WINAPI getSS (VOID)
 
VOID WINAPI setSS (USHORT Value)
 
USHORT WINAPI getDS (VOID)
 
VOID WINAPI setDS (USHORT Value)
 
USHORT WINAPI getES (VOID)
 
VOID WINAPI setES (USHORT Value)
 
USHORT WINAPI getFS (VOID)
 
VOID WINAPI setFS (USHORT Value)
 
USHORT WINAPI getGS (VOID)
 
VOID WINAPI setGS (USHORT Value)
 
ULONG WINAPI getCF (VOID)
 
VOID WINAPI setCF (ULONG Flag)
 
ULONG WINAPI getPF (VOID)
 
VOID WINAPI setPF (ULONG Flag)
 
ULONG WINAPI getAF (VOID)
 
VOID WINAPI setAF (ULONG Flag)
 
ULONG WINAPI getZF (VOID)
 
VOID WINAPI setZF (ULONG Flag)
 
ULONG WINAPI getSF (VOID)
 
VOID WINAPI setSF (ULONG Flag)
 
ULONG WINAPI getIF (VOID)
 
VOID WINAPI setIF (ULONG Flag)
 
ULONG WINAPI getDF (VOID)
 
VOID WINAPI setDF (ULONG Flag)
 
ULONG WINAPI getOF (VOID)
 
VOID WINAPI setOF (ULONG Flag)
 
ULONG WINAPI getEFLAGS (VOID)
 
VOID WINAPI setEFLAGS (ULONG Flags)
 
USHORT WINAPI getMSW (VOID)
 
VOID WINAPI setMSW (USHORT Value)
 

Variables

X86CONTEXT IntelRegPtr
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file registers.c.

Function Documentation

◆ getAF()

ULONG WINAPI getAF ( VOID  )

Definition at line 594 of file registers.c.

595 {
596  return EmulatorContext.Flags.Af;
597 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ getAH()

UCHAR WINAPI getAH ( VOID  )

Definition at line 128 of file registers.c.

129 {
130  return EmulatorContext.GeneralRegs[FAST486_REG_EAX].HighByte;
131 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosBootstrapLoader(), BiosDiskService(), BiosKeyboardService(), BiosMiscService(), BiosTimeService(), ConDrvReadInput(), DosInt21h(), DosInt2Fh(), EmsIntHandler(), VidBiosVideoService(), and XmsBopProcedure().

◆ getAL()

UCHAR WINAPI getAL ( VOID  )

Definition at line 142 of file registers.c.

143 {
144  return EmulatorContext.GeneralRegs[FAST486_REG_EAX].LowByte;
145 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosDiskService(), BiosKeyboardIrq(), BiosMiscService(), BiosMousePs2Interface(), ConDrvReadInput(), DosInt21h(), DosInt2Fh(), EmsIntHandler(), VbeService(), and VidBiosVideoService().

◆ getAX()

◆ getBH()

UCHAR WINAPI getBH ( VOID  )

Definition at line 184 of file registers.c.

185 {
186  return EmulatorContext.GeneralRegs[FAST486_REG_EBX].HighByte;
187 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosDiskService(), BiosMiscService(), BiosMousePs2Interface(), VbeService(), and VidBiosVideoService().

◆ getBL()

UCHAR WINAPI getBL ( VOID  )

Definition at line 198 of file registers.c.

199 {
200  return EmulatorContext.GeneralRegs[FAST486_REG_EBX].LowByte;
201 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosMiscService(), BiosMousePs2Interface(), DosInt21h(), VbeService(), VidBiosSetVideoMode(), VidBiosVideoService(), and XmsBopProcedure().

◆ getBP()

USHORT WINAPI getBP ( VOID  )

Definition at line 374 of file registers.c.

375 {
376  return EmulatorContext.GeneralRegs[FAST486_REG_EBP].LowWord;
377 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosKeyboardIrq(), BiosTimerIrq(), CallMouseUserHandlers(), DosCallDriver(), DosRestoreState(), DosSaveState(), and VidBiosVideoService().

◆ getBX()

◆ getCF()

ULONG WINAPI getCF ( VOID  )

Definition at line 566 of file registers.c.

567 {
568  return EmulatorContext.Flags.Cf;
569 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosKeyboardIrq(), BiosMiscService(), DosControlBreak(), and DosIdle().

◆ getCH()

UCHAR WINAPI getCH ( VOID  )

Definition at line 242 of file registers.c.

243 {
244  return EmulatorContext.GeneralRegs[FAST486_REG_ECX].HighByte;
245 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosDiskService(), DosInt21h(), and VidBiosVideoService().

◆ getCL()

UCHAR WINAPI getCL ( VOID  )

Definition at line 256 of file registers.c.

257 {
258  return EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowByte;
259 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosDiskService(), DosInt21h(), and VidBiosVideoService().

◆ getCS()

USHORT WINAPI getCS ( VOID  )

Definition at line 480 of file registers.c.

481 {
482  return EmulatorContext.SegmentRegs[FAST486_REG_CS].Selector;
483 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by Call16(), CmdStartComSpec32(), CmdStartExternalCommand(), ControlBop(), DeviceInterruptBop(), DosCmdInterpreterBop(), DosInitialize(), DosStart(), DosSystemBop(), KbdBiosINT(), KbdBiosIRQ(), setEIP(), setIP(), ThirdPartyVDDBop(), and VidBiosINT().

◆ getCX()

◆ getDF()

ULONG WINAPI getDF ( VOID  )

Definition at line 650 of file registers.c.

651 {
652  return EmulatorContext.Flags.Df;
653 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ getDH()

UCHAR WINAPI getDH ( VOID  )

Definition at line 300 of file registers.c.

301 {
302  return EmulatorContext.GeneralRegs[FAST486_REG_EDX].HighByte;
303 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosDiskService(), DosInt21h(), VbeService(), and VidBiosVideoService().

◆ getDI()

USHORT WINAPI getDI ( VOID  )

◆ getDL()

UCHAR WINAPI getDL ( VOID  )

Definition at line 314 of file registers.c.

315 {
316  return EmulatorContext.GeneralRegs[FAST486_REG_EDX].LowByte;
317 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosDiskService(), DosInt21h(), VbeService(), VidBiosSetVideoMode(), and VidBiosVideoService().

◆ getDS()

◆ getDX()

◆ getEAX()

ULONG WINAPI getEAX ( VOID  )

Definition at line 100 of file registers.c.

101 {
102  return EmulatorContext.GeneralRegs[FAST486_REG_EAX].Long;
103 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ getEBP()

ULONG WINAPI getEBP ( VOID  )

Definition at line 360 of file registers.c.

361 {
362  return EmulatorContext.GeneralRegs[FAST486_REG_EBP].Long;
363 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ getEBX()

ULONG WINAPI getEBX ( VOID  )

Definition at line 156 of file registers.c.

157 {
158  return EmulatorContext.GeneralRegs[FAST486_REG_EBX].Long;
159 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosMiscService().

◆ getECX()

ULONG WINAPI getECX ( VOID  )

Definition at line 214 of file registers.c.

215 {
216  return EmulatorContext.GeneralRegs[FAST486_REG_ECX].Long;
217 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosMiscService().

◆ getEDI()

ULONG WINAPI getEDI ( VOID  )

Definition at line 420 of file registers.c.

421 {
422  return EmulatorContext.GeneralRegs[FAST486_REG_EDI].Long;
423 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ getEDX()

ULONG WINAPI getEDX ( VOID  )

Definition at line 272 of file registers.c.

273 {
274  return EmulatorContext.GeneralRegs[FAST486_REG_EDX].Long;
275 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosMiscService().

◆ getEFLAGS()

ULONG WINAPI getEFLAGS ( VOID  )

Definition at line 680 of file registers.c.

681 {
682  return EmulatorContext.Flags.Long;
683 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by DosLoadExecutableInternal(), DosStart(), KbdBiosINT(), KbdBiosIRQ(), and VidBiosINT().

◆ getEIP()

ULONG WINAPI getEIP ( VOID  )

Definition at line 450 of file registers.c.

451 {
452  return EmulatorContext.InstPtr.Long;
453 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ getES()

◆ getESI()

ULONG WINAPI getESI ( VOID  )

Definition at line 390 of file registers.c.

391 {
392  return EmulatorContext.GeneralRegs[FAST486_REG_ESI].Long;
393 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ getESP()

ULONG WINAPI getESP ( VOID  )

Definition at line 330 of file registers.c.

331 {
332  return EmulatorContext.GeneralRegs[FAST486_REG_ESP].Long;
333 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ getFS()

USHORT WINAPI getFS ( VOID  )

Definition at line 536 of file registers.c.

537 {
538  return EmulatorContext.SegmentRegs[FAST486_REG_FS].Selector;
539 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ getGS()

USHORT WINAPI getGS ( VOID  )

Definition at line 550 of file registers.c.

551 {
552  return EmulatorContext.SegmentRegs[FAST486_REG_GS].Selector;
553 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ getIF()

ULONG WINAPI getIF ( VOID  )

Definition at line 636 of file registers.c.

637 {
638  return EmulatorContext.Flags.If;
639 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by VbeResetExtendedRegisters(), and VbeSetExtendedRegisters().

◆ getIntelRegistersPointer()

PVOID WINAPI getIntelRegistersPointer ( VOID  )

Definition at line 29 of file registers.c.

30 {
31  /*
32  * Sync the Intel Registers x86 Context with our CPU context
33  */
34 
36  {
37  IntelRegPtr.Dr0 = EmulatorContext.DebugRegisters[FAST486_REG_DR0];
38  IntelRegPtr.Dr1 = EmulatorContext.DebugRegisters[FAST486_REG_DR1];
39  IntelRegPtr.Dr2 = EmulatorContext.DebugRegisters[FAST486_REG_DR2];
40  IntelRegPtr.Dr3 = EmulatorContext.DebugRegisters[FAST486_REG_DR3];
41  IntelRegPtr.Dr6 = EmulatorContext.DebugRegisters[FAST486_REG_DR6];
42  IntelRegPtr.Dr7 = EmulatorContext.DebugRegisters[FAST486_REG_DR7];
43  }
44 
45 #ifndef FAST486_NO_FPU
47  {
48  // IntelRegPtr.FloatSave = ;
51  // IntelRegPtr.FloatSave.TagWord = ;
52  // IntelRegPtr.FloatSave.ErrorOffset = ;
53  // IntelRegPtr.FloatSave.ErrorSelector = ;
54  // IntelRegPtr.FloatSave.DataOffset = ;
55  // IntelRegPtr.FloatSave.DataSelector = ;
56  // IntelRegPtr.FloatSave.RegisterArea = ; // This is a region of size SIZE_OF_80387_REGISTERS == 80 bytes
57  // IntelRegPtr.FloatSave.Cr0NpxState = ;
58  }
59 #endif
60 
62  {
63  IntelRegPtr.SegGs = EmulatorContext.SegmentRegs[FAST486_REG_GS].Selector;
64  IntelRegPtr.SegFs = EmulatorContext.SegmentRegs[FAST486_REG_FS].Selector;
65  IntelRegPtr.SegEs = EmulatorContext.SegmentRegs[FAST486_REG_ES].Selector;
66  IntelRegPtr.SegDs = EmulatorContext.SegmentRegs[FAST486_REG_DS].Selector;
67  }
68 
70  {
71  IntelRegPtr.Edi = EmulatorContext.GeneralRegs[FAST486_REG_EDI].Long;
72  IntelRegPtr.Esi = EmulatorContext.GeneralRegs[FAST486_REG_ESI].Long;
73  IntelRegPtr.Ebx = EmulatorContext.GeneralRegs[FAST486_REG_EBX].Long;
74  IntelRegPtr.Edx = EmulatorContext.GeneralRegs[FAST486_REG_EDX].Long;
75  IntelRegPtr.Ecx = EmulatorContext.GeneralRegs[FAST486_REG_ECX].Long;
76  IntelRegPtr.Eax = EmulatorContext.GeneralRegs[FAST486_REG_EAX].Long;
77  }
78 
80  {
81  IntelRegPtr.Ebp = EmulatorContext.GeneralRegs[FAST486_REG_EBP].Long;
82  IntelRegPtr.Eip = EmulatorContext.InstPtr.Long;
83  IntelRegPtr.SegCs = EmulatorContext.SegmentRegs[FAST486_REG_CS].Selector;
84  IntelRegPtr.EFlags = EmulatorContext.Flags.Long;
85  IntelRegPtr.Esp = EmulatorContext.GeneralRegs[FAST486_REG_ESP].Long;
86  IntelRegPtr.SegSs = EmulatorContext.SegmentRegs[FAST486_REG_SS].Selector;
87  }
88 
90  {
91  // IntelRegPtr.ExtendedRegisters = ;
92  }
93 
94  /* Return the address of the Intel Registers x86 Context */
95  return &IntelRegPtr;
96 }
ULONG Dr3
Definition: x86context.h:88
X86CONTEXT IntelRegPtr
Definition: registers.c:23
#define CONTEXT_EXTENDED_REGISTERS
ULONG SegDs
Definition: x86context.h:105
ULONG Dr0
Definition: x86context.h:85
#define CONTEXT_SEGMENTS
Definition: nt_native.h:1371
ULONG Dr7
Definition: x86context.h:90
ULONG SegCs
Definition: x86context.h:124
ULONG SegFs
Definition: x86context.h:103
#define CONTEXT_CONTROL
Definition: compat.h:265
ULONG SegEs
Definition: x86context.h:104
ULONG Dr6
Definition: x86context.h:89
#define CONTEXT_FLOATING_POINT
Definition: compat.h:267
ULONG SegSs
Definition: x86context.h:127
ULONG EFlags
Definition: x86context.h:125
FAST486_STATE EmulatorContext
Definition: cpu.c:39
ULONG ContextFlags
Definition: x86context.h:79
ULONG Dr2
Definition: x86context.h:87
ULONG Dr1
Definition: x86context.h:86
X87FLOATING_SAVE_AREA FloatSave
Definition: x86context.h:96
ULONG SegGs
Definition: x86context.h:102
#define CONTEXT_INTEGER
Definition: compat.h:266
#define CONTEXT_DEBUG_REGISTERS
Definition: compat.h:268

◆ getIP()

◆ getMSW()

USHORT WINAPI getMSW ( VOID  )

Definition at line 696 of file registers.c.

697 {
698  return LOWORD(EmulatorContext.ControlRegisters[FAST486_REG_CR0]);
699 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39
#define LOWORD(l)
Definition: pedump.c:82

◆ getOF()

ULONG WINAPI getOF ( VOID  )

Definition at line 664 of file registers.c.

665 {
666  return EmulatorContext.Flags.Of;
667 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ getPF()

ULONG WINAPI getPF ( VOID  )

Definition at line 580 of file registers.c.

581 {
582  return EmulatorContext.Flags.Pf;
583 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ getSF()

ULONG WINAPI getSF ( VOID  )

Definition at line 622 of file registers.c.

623 {
624  return EmulatorContext.Flags.Sf;
625 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ getSI()

USHORT WINAPI getSI ( VOID  )

Definition at line 404 of file registers.c.

405 {
406  return EmulatorContext.GeneralRegs[FAST486_REG_ESI].LowWord;
407 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosKeyboardIrq(), BiosMiscService(), BiosTimerIrq(), CallMouseUserHandlers(), CmdStartExternalCommand(), DosCallDriver(), DosInt21h(), DosInt2Fh(), DosRestoreState(), DosSaveState(), EmsIntHandler(), ThirdPartyVDDBop(), and XmsBopProcedure().

◆ getSP()

USHORT WINAPI getSP ( VOID  )

Definition at line 344 of file registers.c.

345 {
346  return EmulatorContext.GeneralRegs[FAST486_REG_ESP].LowWord;
347 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosMouseIrq(), DosAbsoluteRead(), DosAbsoluteWrite(), DosInt21h(), DosLoadExecutableInternal(), DosRestoreState(), DosSaveState(), DosStart(), and DosTerminateProcess().

◆ getSS()

USHORT WINAPI getSS ( VOID  )

Definition at line 494 of file registers.c.

495 {
496  return EmulatorContext.SegmentRegs[FAST486_REG_SS].Selector;
497 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosMouseIrq(), DosInt21h(), DosLoadExecutableInternal(), DosRestoreState(), DosSaveState(), DosStart(), DosTerminateProcess(), setESP(), and setSP().

◆ getZF()

ULONG WINAPI getZF ( VOID  )

Definition at line 608 of file registers.c.

609 {
610  return EmulatorContext.Flags.Zf;
611 }
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by ConDrvInputStatus().

◆ setAF()

VOID WINAPI setAF ( ULONG  Flag)

Definition at line 601 of file registers.c.

602 {
603  EmulatorContext.Flags.Af = !!(Flag & 1);
604 }
Definition: xml2sdb.h:79
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ setAH()

VOID WINAPI setAH ( UCHAR  Value)

Definition at line 135 of file registers.c.

136 {
137  EmulatorContext.GeneralRegs[FAST486_REG_EAX].HighByte = Value;
138 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosBootstrapLoader(), BiosCharPrint(), BiosDiskService(), BiosKeyboardIrq(), BiosMiscService(), BiosMousePs2Interface(), BiosPs2Service(), ConDrvInputStatus(), ConDrvReadInput(), Dem_BiosCharPrint(), DosFastConOut(), DosInt21h(), EmsIntHandler(), and VbeService().

◆ setAL()

◆ setAX()

◆ setBH()

VOID WINAPI setBH ( UCHAR  Value)

Definition at line 191 of file registers.c.

192 {
193  EmulatorContext.GeneralRegs[FAST486_REG_EBX].HighByte = Value;
194 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosCharPrint(), BiosMousePs2Interface(), Dem_BiosCharPrint(), DosFastConOut(), DosInt21h(), VidBiosVideoService(), and XmsBopProcedure().

◆ setBL()

VOID WINAPI setBL ( UCHAR  Value)

Definition at line 205 of file registers.c.

206 {
207  EmulatorContext.GeneralRegs[FAST486_REG_EBX].LowByte = Value;
208 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosCharPrint(), BiosDiskService(), BiosMousePs2Interface(), Dem_BiosCharPrint(), DosFastConOut(), DosInt21h(), VidBiosVideoService(), XmsBopProcedure(), XmsLocalDisableA20(), and XmsLocalEnableA20().

◆ setBP()

VOID WINAPI setBP ( USHORT  Value)

Definition at line 381 of file registers.c.

382 {
383  EmulatorContext.GeneralRegs[FAST486_REG_EBP].LowWord = Value;
384 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosKeyboardIrq(), BiosTimerIrq(), CallMouseUserHandlers(), DosCallDriver(), DosLoadExecutableInternal(), DosRestoreState(), and VidBiosVideoService().

◆ setBX()

VOID WINAPI setBX ( USHORT  Value)

◆ setCF()

◆ setCH()

VOID WINAPI setCH ( UCHAR  Value)

Definition at line 249 of file registers.c.

250 {
251  EmulatorContext.GeneralRegs[FAST486_REG_ECX].HighByte = Value;
252 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosBootstrapLoader(), BiosDiskService(), BiosTimeService(), DosMouseService(), and VidBiosVideoService().

◆ setCL()

VOID WINAPI setCL ( UCHAR  Value)

Definition at line 263 of file registers.c.

264 {
265  EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowByte = Value;
266 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosBootstrapLoader(), BiosDiskService(), BiosMousePs2Interface(), BiosTimeService(), DosMouseService(), and VidBiosVideoService().

◆ setCS()

VOID WINAPI setCS ( USHORT  Value)

Definition at line 487 of file registers.c.

488 {
489  Fast486SetSegment(&EmulatorContext, FAST486_REG_CS, Value);
490 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
VOID NTAPI Fast486SetSegment(PFAST486_STATE State, FAST486_SEG_REGS Segment, USHORT Selector)
Definition: fast486.c:242
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by Bios32Post(), Call16(), DosInitialize(), KbdBiosINT(), KbdBiosIRQ(), and VidBiosINT().

◆ setCX()

VOID WINAPI setCX ( USHORT  Value)

Definition at line 235 of file registers.c.

236 {
237  EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowWord = Value;
238 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosBootstrapLoader(), BiosDiskService(), BiosKeyboardIrq(), BiosMiscService(), BiosTimerIrq(), BiosTimeService(), CallMouseUserHandlers(), DosCallDriver(), DosInt21h(), DosLoadExecutableInternal(), DosMouseService(), DosRestoreState(), EmsIntHandler(), VbeService(), and VidBiosVideoService().

◆ setDF()

VOID WINAPI setDF ( ULONG  Flag)

Definition at line 657 of file registers.c.

658 {
659  EmulatorContext.Flags.Df = !!(Flag & 1);
660 }
Definition: xml2sdb.h:79
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ setDH()

VOID WINAPI setDH ( UCHAR  Value)

Definition at line 307 of file registers.c.

308 {
309  EmulatorContext.GeneralRegs[FAST486_REG_EDX].HighByte = Value;
310 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosBootstrapLoader(), BiosDiskService(), BiosTimeService(), DosInt21h(), and VidBiosVideoService().

◆ setDI()

VOID WINAPI setDI ( USHORT  Value)

Definition at line 441 of file registers.c.

442 {
443  EmulatorContext.GeneralRegs[FAST486_REG_EDI].LowWord = Value;
444 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosDiskService(), BiosKeyboardIrq(), BiosTimerIrq(), CallMouseUserHandlers(), DosCallDriver(), DosLoadExecutableInternal(), DosMouseService(), and DosRestoreState().

◆ setDL()

VOID WINAPI setDL ( UCHAR  Value)

Definition at line 321 of file registers.c.

322 {
323  EmulatorContext.GeneralRegs[FAST486_REG_EDX].LowByte = Value;
324 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosBootstrapLoader(), BiosDiskService(), BiosMousePs2Interface(), BiosTimeService(), DosInt21h(), and VidBiosVideoService().

◆ setDS()

VOID WINAPI setDS ( USHORT  Value)

Definition at line 515 of file registers.c.

516 {
517  Fast486SetSegment(&EmulatorContext, FAST486_REG_DS, Value);
518 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
VOID NTAPI Fast486SetSegment(PFAST486_STATE State, FAST486_SEG_REGS Segment, USHORT Selector)
Definition: fast486.c:242
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by Bios32Post(), BiosKeyboardIrq(), BiosTimerIrq(), CallMouseUserHandlers(), DosBIOSInitialize(), DosCallDriver(), DosInt21h(), DosInt2Fh(), DosKRNLInitialize(), DosLoadExecutableInternal(), DosRestoreState(), and InitRomRange().

◆ setDX()

◆ setEAX()

VOID WINAPI setEAX ( ULONG  Value)

Definition at line 107 of file registers.c.

108 {
109  EmulatorContext.GeneralRegs[FAST486_REG_EAX].Long = Value;
110 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosMiscService().

◆ setEBP()

VOID WINAPI setEBP ( ULONG  Value)

Definition at line 367 of file registers.c.

368 {
369  EmulatorContext.GeneralRegs[FAST486_REG_EBP].Long = Value;
370 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ setEBX()

VOID WINAPI setEBX ( ULONG  Value)

Definition at line 163 of file registers.c.

164 {
165  EmulatorContext.GeneralRegs[FAST486_REG_EBX].Long = Value;
166 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosMiscService().

◆ setECX()

VOID WINAPI setECX ( ULONG  Value)

Definition at line 221 of file registers.c.

222 {
223  EmulatorContext.GeneralRegs[FAST486_REG_ECX].Long = Value;
224 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosMiscService().

◆ setEDI()

VOID WINAPI setEDI ( ULONG  Value)

Definition at line 427 of file registers.c.

428 {
429  EmulatorContext.GeneralRegs[FAST486_REG_EDI].Long = Value;
430 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ setEDX()

VOID WINAPI setEDX ( ULONG  Value)

Definition at line 279 of file registers.c.

280 {
281  EmulatorContext.GeneralRegs[FAST486_REG_EDX].Long = Value;
282 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ setEFLAGS()

VOID WINAPI setEFLAGS ( ULONG  Flags)

Definition at line 687 of file registers.c.

688 {
689  EmulatorContext.Flags.Long = Flags;
690 }
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by DosLoadExecutableInternal(), KbdBiosINT(), KbdBiosIRQ(), and VidBiosINT().

◆ setEIP()

VOID WINAPI setEIP ( ULONG  Value)

Definition at line 457 of file registers.c.

458 {
459  CpuExecute(getCS(), Value);
460 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
USHORT WINAPI getCS(VOID)
Definition: registers.c:480
VOID CpuExecute(WORD Segment, WORD Offset)
Definition: cpu.c:102

◆ setES()

VOID WINAPI setES ( USHORT  Value)

Definition at line 529 of file registers.c.

530 {
531  Fast486SetSegment(&EmulatorContext, FAST486_REG_ES, Value);
532 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
VOID NTAPI Fast486SetSegment(PFAST486_STATE State, FAST486_SEG_REGS Segment, USHORT Selector)
Definition: fast486.c:242
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosBootstrapLoader(), BiosDiskService(), BiosKeyboardIrq(), BiosMiscService(), BiosTimerIrq(), CallMouseUserHandlers(), DosCallDriver(), DosInt21h(), DosInt2Fh(), DosLoadExecutableInternal(), DosMouseService(), DosRestoreState(), and VidBiosVideoService().

◆ setESI()

VOID WINAPI setESI ( ULONG  Value)

Definition at line 397 of file registers.c.

398 {
399  EmulatorContext.GeneralRegs[FAST486_REG_ESI].Long = Value;
400 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ setESP()

VOID WINAPI setESP ( ULONG  Value)

Definition at line 337 of file registers.c.

338 {
340 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
VOID NTAPI Fast486SetStack(PFAST486_STATE State, USHORT Segment, ULONG Offset)
Definition: fast486.c:227
USHORT WINAPI getSS(VOID)
Definition: registers.c:494
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ setFS()

VOID WINAPI setFS ( USHORT  Value)

Definition at line 543 of file registers.c.

544 {
545  Fast486SetSegment(&EmulatorContext, FAST486_REG_FS, Value);
546 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
VOID NTAPI Fast486SetSegment(PFAST486_STATE State, FAST486_SEG_REGS Segment, USHORT Selector)
Definition: fast486.c:242
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ setGS()

VOID WINAPI setGS ( USHORT  Value)

Definition at line 557 of file registers.c.

558 {
559  Fast486SetSegment(&EmulatorContext, FAST486_REG_GS, Value);
560 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
VOID NTAPI Fast486SetSegment(PFAST486_STATE State, FAST486_SEG_REGS Segment, USHORT Selector)
Definition: fast486.c:242
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ setIF()

VOID WINAPI setIF ( ULONG  Flag)

Definition at line 643 of file registers.c.

644 {
645  EmulatorContext.Flags.If = !!(Flag & 1);
646 }
Definition: xml2sdb.h:79
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by Bios32Post(), BiosInitialize(), VbeResetExtendedRegisters(), VbeSetExtendedRegisters(), and VgaSetRegisters().

◆ setIP()

VOID WINAPI setIP ( USHORT  Value)

Definition at line 471 of file registers.c.

472 {
473  CpuExecute(getCS(), Value);
474 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
USHORT WINAPI getCS(VOID)
Definition: registers.c:480
VOID CpuExecute(WORD Segment, WORD Offset)
Definition: cpu.c:102

Referenced by Bios32Post(), Call16(), ControlBop(), DosCmdInterpreterBop(), DosInitialize(), DosSystemBop(), KbdBiosINT(), KbdBiosIRQ(), ThirdPartyVDDBop(), and VidBiosINT().

◆ setMSW()

VOID WINAPI setMSW ( USHORT  Value)

Definition at line 703 of file registers.c.

704 {
705  /* Set the lower 16 bits (Machine Status Word) of CR0 */
706  EmulatorContext.ControlRegisters[FAST486_REG_CR0] &= 0xFFFF0000;
707  EmulatorContext.ControlRegisters[FAST486_REG_CR0] |= Value & 0xFFFF;
708 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ setOF()

VOID WINAPI setOF ( ULONG  Flag)

Definition at line 671 of file registers.c.

672 {
673  EmulatorContext.Flags.Of = !!(Flag & 1);
674 }
Definition: xml2sdb.h:79
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ setPF()

VOID WINAPI setPF ( ULONG  Flag)

Definition at line 587 of file registers.c.

588 {
589  EmulatorContext.Flags.Pf = !!(Flag & 1);
590 }
Definition: xml2sdb.h:79
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ setSF()

VOID WINAPI setSF ( ULONG  Flag)

Definition at line 629 of file registers.c.

630 {
631  EmulatorContext.Flags.Sf = !!(Flag & 1);
632 }
Definition: xml2sdb.h:79
FAST486_STATE EmulatorContext
Definition: cpu.c:39

◆ setSI()

VOID WINAPI setSI ( USHORT  Value)

Definition at line 411 of file registers.c.

412 {
413  EmulatorContext.GeneralRegs[FAST486_REG_ESI].LowWord = Value;
414 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by BiosKeyboardIrq(), BiosTimerIrq(), CallMouseUserHandlers(), DosCallDriver(), DosInt21h(), DosLoadExecutableInternal(), and DosRestoreState().

◆ setSP()

VOID WINAPI setSP ( USHORT  Value)

Definition at line 351 of file registers.c.

352 {
354 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
VOID NTAPI Fast486SetStack(PFAST486_STATE State, USHORT Segment, ULONG Offset)
Definition: fast486.c:227
USHORT WINAPI getSS(VOID)
Definition: registers.c:494
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by Bios32Post(), BiosMouseIrq(), DosAbsoluteRead(), DosAbsoluteWrite(), DosBIOSInitialize(), DosKRNLInitialize(), DosLoadExecutableInternal(), DosRestoreState(), DosSaveState(), DosStart(), and DosTerminateProcess().

◆ setSS()

VOID WINAPI setSS ( USHORT  Value)

Definition at line 501 of file registers.c.

502 {
503  Fast486SetSegment(&EmulatorContext, FAST486_REG_SS, Value);
504 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
VOID NTAPI Fast486SetSegment(PFAST486_STATE State, FAST486_SEG_REGS Segment, USHORT Selector)
Definition: fast486.c:242
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Referenced by Bios32Post(), DosBIOSInitialize(), DosKRNLInitialize(), DosLoadExecutableInternal(), and DosTerminateProcess().

◆ setZF()

VOID WINAPI setZF ( ULONG  Flag)

Definition at line 615 of file registers.c.

616 {
617  EmulatorContext.Flags.Zf = !!(Flag & 1);
618 }
Definition: xml2sdb.h:79
FAST486_STATE EmulatorContext
Definition: cpu.c:39

Variable Documentation

◆ IntelRegPtr

X86CONTEXT IntelRegPtr

Definition at line 23 of file registers.c.

Referenced by getIntelRegistersPointer().