/* 
 * DANG_BEGIN_MODULE
 * 
 *
 * DANG_END_MODULE
 *
 * DANG_BEGIN_CHANGELOG
 *
 * $Date: $
 * $Source: $
 * $Revision: $
 * $State: $
 *
 * $Log: $
 *
 * DANG_END_CHANGELOG
 */

#include "dosemu.h"
#include "base/cpu.h"
#include "base/bios_entry.h"

/* 
 * DANG_BEGIN_FUNCTION cpu_reset
 *
 * Description:
 *   Set the CPU registers at start time to their default values.
 *
 * DANG_END_FUNCTION
 */
void cpu_reset(void)
{
  _EAX = 0;
  _EBX = 0;
  _ECX = 0;
  _EDX = 0;
  _ESI = 0;
  _EDI = 0;
  _EBP = 0;
  _ESP = 0x0100;
#if 0
  _EIP = 0x0000;
  _CS  = 0xFFFF;
#else
  _EIP = ROM_BIOS_SELFTEST;
  _CS  = BIOSSEG;
#endif
  _DS  = 0x0040;
  _ES  = 0;
  _SS  = 0x0030;
  _FS  = 0;
  _GS  = 0;
  _EFLAGS |= (VIF | VIP);
}
