Author: aandrejevic
Date: Sun Oct 6 15:22:52 2013
New Revision: 60562
URL:
http://svn.reactos.org/svn/reactos?rev=60562&view=rev
Log:
[SOFT386]
Start implementing extended opcodes.
Added:
branches/ntvdm/lib/soft386/extraops.c (with props)
branches/ntvdm/lib/soft386/extraops.h (with props)
Modified:
branches/ntvdm/lib/soft386/CMakeLists.txt
branches/ntvdm/lib/soft386/opcodes.c
Modified: branches/ntvdm/lib/soft386/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/CMakeLists.tx…
==============================================================================
--- branches/ntvdm/lib/soft386/CMakeLists.txt [iso-8859-1] (original)
+++ branches/ntvdm/lib/soft386/CMakeLists.txt [iso-8859-1] Sun Oct 6 15:22:52 2013
@@ -5,6 +5,7 @@
soft386.c
opcodes.c
opgroups.c
+ extraops.c
common.c)
add_library(soft386 ${SOURCE})
Added: branches/ntvdm/lib/soft386/extraops.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/extraops.c?re…
==============================================================================
--- branches/ntvdm/lib/soft386/extraops.c (added)
+++ branches/ntvdm/lib/soft386/extraops.c [iso-8859-1] Sun Oct 6 15:22:52 2013
@@ -0,0 +1,322 @@
+/*
+ * Soft386 386/486 CPU Emulation Library
+ * extraops.c
+ *
+ * Copyright (C) 2013 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/* INCLUDES *******************************************************************/
+
+// #define WIN32_NO_STATUS
+// #define _INC_WINDOWS
+#include <windef.h>
+
+// #define NDEBUG
+#include <debug.h>
+
+#include <soft386.h>
+#include "opcodes.h"
+#include "common.h"
+
+/* PUBLIC VARIABLES ***********************************************************/
+
+SOFT386_OPCODE_HANDLER_PROC
+Soft386ExtendedHandlers[SOFT386_NUM_OPCODE_HANDLERS] =
+{
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+ NULL, // TODO: NOT IMPLEMENTED
+};
+
+/* PUBLIC FUNCTIONS ***********************************************************/
+
+SOFT386_OPCODE_HANDLER(Soft386OpcodeExtended)
+{
+ UCHAR SecondOpcode;
+
+ /* Fetch the second operation code */
+ if (!Soft386FetchByte(State, &SecondOpcode))
+ {
+ /* Exception occurred */
+ return FALSE;
+ }
+
+ if (Soft386ExtendedHandlers[SecondOpcode] != NULL)
+ {
+ /* Call the extended opcode handler */
+ return Soft386ExtendedHandlers[SecondOpcode](State, SecondOpcode);
+ }
+ else
+ {
+ /* This is not a valid opcode */
+ Soft386Exception(State, SOFT386_EXCEPTION_UD);
+ return FALSE;
+ }
+}
Propchange: branches/ntvdm/lib/soft386/extraops.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: branches/ntvdm/lib/soft386/extraops.h
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/extraops.h?re…
==============================================================================
--- branches/ntvdm/lib/soft386/extraops.h (added)
+++ branches/ntvdm/lib/soft386/extraops.h [iso-8859-1] Sun Oct 6 15:22:52 2013
@@ -0,0 +1,31 @@
+/*
+ * Soft386 386/486 CPU Emulation Library
+ * extraops.h
+ *
+ * Copyright (C) 2013 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _EXTRAOPS_H_
+#define _EXTRAOPS_H_
+
+/* DEFINES ********************************************************************/
+SOFT386_OPCODE_HANDLER(Soft386OpcodeExtended);
+
+#endif // _EXTRAOPS_H_
+
+/* EOF */
+
Propchange: branches/ntvdm/lib/soft386/extraops.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: branches/ntvdm/lib/soft386/opcodes.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/opcodes.c?rev…
==============================================================================
--- branches/ntvdm/lib/soft386/opcodes.c [iso-8859-1] (original)
+++ branches/ntvdm/lib/soft386/opcodes.c [iso-8859-1] Sun Oct 6 15:22:52 2013
@@ -32,6 +32,7 @@
#include <soft386.h>
#include "opcodes.h"
#include "opgroups.h"
+#include "extraops.h"
#include "common.h"
/* PUBLIC VARIABLES ***********************************************************/
@@ -54,7 +55,7 @@
Soft386OpcodeOrAl,
Soft386OpcodeOrEax,
Soft386OpcodePushCs,
- NULL, // TODO: OPCODE 0x0F NOT SUPPORTED
+ Soft386OpcodeExtended,
Soft386OpcodeAdcByteModrm,
Soft386OpcodeAdcModrm,
Soft386OpcodeAdcByteModrm,