[NTVDM]
[reactos.git] / lib / 3rdparty / softx86 / softx86 / fpu.c
1 /*
2 * fpu.c
3 *
4 * Copyright (C) 2003, 2004 Jonathan Campbell <jcampbell@mdjk.com>
5 *
6 * Handles 80x87 FPU opcodes by passing them down through callbacks
7 * set up in application.
8 *
9 * The idea behind this is to handle these opcodes the same way the
10 * 8086, 80286, 80386, and some 80486s handled them by passing them
11 * off to an optional external FPU (possibly provided by another
12 * library similar to this).
13 *
14 ***********************************************************************************
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 ************************************************************************************/
29
30 #include <softx86.h>
31 #include <memory.h>
32 #include <stdio.h>
33 #include <string.h>
34 #include "optable.h"
35 #include "fpu.h"
36
37 int Sfx86OpcodeExec_fpuhandoff(sx86_ubyte opcode,softx86_ctx* ctx)
38 {
39 return ctx->callbacks->on_fpu_opcode_exec(ctx,ctx->ref_softx87_ctx,opcode);
40 }
41
42 int Sfx86OpcodeDec_fpuhandoff(sx86_ubyte opcode,softx86_ctx* ctx,char buf[128])
43 {
44 return ctx->callbacks->on_fpu_opcode_dec(ctx,ctx->ref_softx87_ctx,opcode,buf);
45 }