1
0
Fork 0

Added FBLD

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1950
This commit is contained in:
Peter Veenstra 2004-09-08 08:46:37 +00:00
parent 4e55ec7806
commit 93aeccfb4b
2 changed files with 28 additions and 3 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: fpu.cpp,v 1.21 2004-08-04 09:12:54 qbix79 Exp $ */
/* $Id: fpu.cpp,v 1.22 2004-09-08 08:46:37 qbix79 Exp $ */
#include "dosbox.h"
#if C_FPU
@ -709,7 +709,11 @@ void FPU_ESC7_EA(Bitu rm,PhysPt addr) {
FPU_FPOP();
break;
case 0x04: /* FBLD packed BCD */
//Don't think anybody will ever use this.
{
Real64 in = FPU_FBLD(addr);
FPU_PUSH(in);
}
break;
default:
LOG(LOG_FPU,LOG_WARN)("ESC 7 EA:Unhandled group %d subfunction %d",group,sub);
break;

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: fpu_instructions.h,v 1.18 2004-08-04 09:12:54 qbix79 Exp $ */
/* $Id: fpu_instructions.h,v 1.19 2004-09-08 08:46:37 qbix79 Exp $ */
static void FPU_FINIT(void) {
@ -262,6 +262,27 @@ static void FPU_FBST(PhysPt addr)
mem_writeb(addr+9,p);
}
static Real64 FPU_FBLD(PhysPt addr)
{
Real64 val = 0;
Bitu in = 0;
Bit64u base = 1;
for(Bitu i = 0;i < 9;i++){
in = mem_readb(addr + i);
val += ( (in&9) * base);
base *= 10;
val += ((( in>>4)&9) * base);
base *= 10;
}
//last number
in = mem_readb(addr + 9);
val += ( (in&9) * base );
if(in&0x80) val *= -1.0;
return val;
}
#define BIAS80 16383
#define BIAS64 1023