From 5794ebcb0eeb88149d084dcdbab8116ecfec0b65 Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Sat, 14 Jun 2003 07:24:17 +0000 Subject: [PATCH] Added HLT instruction Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1053 --- include/cpu.h | 5 ++++- src/cpu/core_full/load.h | 4 ++++ src/cpu/core_full/optable.h | 2 +- src/cpu/core_full/support.h | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/cpu.h b/include/cpu.h index 5dbfe745..b2036e46 100644 --- a/include/cpu.h +++ b/include/cpu.h @@ -103,7 +103,7 @@ bool CPU_IRET(bool use32); bool CPU_SetSegGeneral(SegNames seg,Bitu value); void CPU_CPUID(void); - +void CPU_HLT(void); //Flag Handling Bitu get_CF(void); @@ -386,6 +386,9 @@ struct CPUBlock { struct { Bitu prefix,entry; } full; + struct { + Bitu eip,cs; + } hlt; }; extern CPUBlock cpu; diff --git a/src/cpu/core_full/load.h b/src/cpu/core_full/load.h index f90180fc..9636a499 100644 --- a/src/cpu/core_full/load.h +++ b/src/cpu/core_full/load.h @@ -469,6 +469,10 @@ l_M_Ed: case D_CPUID: CPU_CPUID(); goto nextopcode; + case D_HLT: + SaveIP(); + CPU_HLT(); + return 0x0; default: LOG(LOG_CPU,LOG_ERROR)("LOAD:Unhandled code %d opcode %X",inst.code.load,inst.entry); break; diff --git a/src/cpu/core_full/optable.h b/src/cpu/core_full/optable.h index b74bbc9f..116fb3c9 100644 --- a/src/cpu/core_full/optable.h +++ b/src/cpu/core_full/optable.h @@ -172,7 +172,7 @@ static OpCode OpCodeTable[1024]={ /* 0xf0 - 0xf7 */ {0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 }, {L_PREREPNE ,0 ,0 ,0 },{L_PREREP ,0 ,0 ,0 }, -{0 ,0 ,0 ,0 },{D_CMC ,0 ,0 ,0 }, +{D_HLT ,0 ,0 ,0 },{D_CMC ,0 ,0 ,0 }, {L_MODRM ,8 ,0 ,M_GRP },{L_MODRM ,9 ,0 ,M_GRP }, /* 0xf8 - 0xff */ {D_CLC ,0 ,0 ,0 },{D_STC ,0 ,0 ,0 }, diff --git a/src/cpu/core_full/support.h b/src/cpu/core_full/support.h index df35dc4f..6aa563bf 100644 --- a/src/cpu/core_full/support.h +++ b/src/cpu/core_full/support.h @@ -44,6 +44,7 @@ enum { D_RETFw,D_RETFd, D_RETFwIw,D_RETFdIw, D_CPUID, + D_HLT, };