Author: greatlrd
Date: Sat Jan 13 15:23:25 2007
New Revision: 25438
URL:
http://svn.reactos.org/svn/reactos?rev=25438&view=rev
Log:
adding option for disambler mode, disambler mode does not translate a binary file. it
doing a disambler of the file
Modified:
trunk/rosapps/devutils/cputointel/CpuToIntel.c
trunk/rosapps/devutils/cputointel/From/ARM/ARM.h
trunk/rosapps/devutils/cputointel/From/ARM/ARMBrain.c
trunk/rosapps/devutils/cputointel/From/ARM/ARMopcode.c
trunk/rosapps/devutils/cputointel/From/PPC/PPC.h
trunk/rosapps/devutils/cputointel/From/PPC/PPCBrain.c
trunk/rosapps/devutils/cputointel/From/PPC/PPCopcode.c
trunk/rosapps/devutils/cputointel/From/dummycpu/Dummy.h
trunk/rosapps/devutils/cputointel/From/dummycpu/DummyBrain.c
trunk/rosapps/devutils/cputointel/From/dummycpu/Dummyopcode.c
trunk/rosapps/devutils/cputointel/From/m68k/M68kBrain.c
trunk/rosapps/devutils/cputointel/From/m68k/M68kopcode.c
trunk/rosapps/devutils/cputointel/From/m68k/m68k.h
trunk/rosapps/devutils/cputointel/ImageLoader.c
trunk/rosapps/devutils/cputointel/misc.h
Modified: trunk/rosapps/devutils/cputointel/CpuToIntel.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/CpuToI…
==============================================================================
--- trunk/rosapps/devutils/cputointel/CpuToIntel.c (original)
+++ trunk/rosapps/devutils/cputointel/CpuToIntel.c Sat Jan 13 15:23:25 2007
@@ -13,6 +13,7 @@
char *outfile=NULL;
char *cpuid=NULL;
CPU_INT type=0;
+ CPU_INT mode = 1;
printf("Usage :\n");
@@ -35,6 +36,7 @@
printf(" -inBin filename : the bin file you whant convert\n");
printf(" -inExe filename : the PE file you whant convert\n");
printf(" -OutAsm filename : the Asm file you whant create\n");
+ printf(" -OutDis filename : Do disambler of the source file\n");
printf("------------------------------------------------------------------\n");
printf("More cpu will be added with the time or options, this is
\n");
printf("version 0.0.1 of the cpu to intel converter writen by
\n");
@@ -42,10 +44,12 @@
printf("yet, more that basic desgin how it should be writen.
\n");
printf("Copyright 2006 by Magnus Olsen, licen under GPL 2.0 for now.
\n");
- if (argc < 7)
- return .110;
- for (t=1; t<7;t+=2)
+ if (argc <4)
+ return 110;
+
+ /* fixme better error checking for the input param */
+ for (t=1; t<argc;t+=2)
{
if (stricmp(argv[t],"-in"))
{
@@ -69,6 +73,11 @@
{
outfile = argv[t+1];
}
+ if (stricmp(argv[t],"-OutDis"))
+ {
+ outfile = argv[t+1];
+ mode = 0;
+ }
if (stricmp(argv[t],"-BaseAddress"))
{
BaseAddress = atol(argv[t+1]);
@@ -80,7 +89,8 @@
}
- return LoadPFileImage(infile,outfile,BaseAddress,cpuid,type);
+
+ return LoadPFileImage(infile,outfile,BaseAddress,cpuid,type, mode);
//return
LoadPFileImage("e:\\cputointel.exe","e:\\cputointel.asm",0,0,0);
}
Modified: trunk/rosapps/devutils/cputointel/From/ARM/ARM.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/A…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/ARM/ARM.h (original)
+++ trunk/rosapps/devutils/cputointel/From/ARM/ARM.h Sat Jan 13 15:23:25 2007
@@ -6,10 +6,11 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp);
+ FILE *outfp,
+ CPU_INT mode);
/* here we put the prototype for the opcode api that brain need we show a example for it
*/
-CPU_INT ARM_(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
+CPU_INT ARM_(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
/* Export comment thing see m68k for example
Modified: trunk/rosapps/devutils/cputointel/From/ARM/ARMBrain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/A…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/ARM/ARMBrain.c (original)
+++ trunk/rosapps/devutils/cputointel/From/ARM/ARMBrain.c Sat Jan 13 15:23:25 2007
@@ -5,7 +5,33 @@
#include "ARM.h"
#include "../../misc.h"
-/* retun
+/*
+ * DummyBrain is example how you create you own cpu brain to translate from
+ * cpu to intel assembler, I have not add DummyBrain to the loader it is not
+ * need it in our example. When you write you own brain, it must be setup in
+ * misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not
+ * need the brain you have writen so you do not need setup it there then.
+ *
+ * input param:
+ * cpu_buffer : the memory buffer with loaded program we whant translate
+ * cpu_pos : the positions in the cpu_buffer
+ * cpu_size : the alloced memory size of the cpu_buffer
+ * BaseAddress : the virtual memory address we setup to use.
+ * cpuarch : the sub arch for the brain, example if it exists more one
+ * cpu with same desgin but few other opcode or extend opcode
+ * outfp : the output file pointer
+ *
+ * mode : if we should run disambler of this binary or
+ * translate it, Disambler will not calc the
+ * the row name right so we simple give each
+ row a name. In translations mode we run a
+ * analys so we getting better optimzing and
+ * only row name there we need.
+ * value for mode are :
+ * 0 = disambler mode
+ * 1 = translate mode intel
+ *
+ * return value
* 0 : Ok
* 1 : unimplemt
* 2 : Unkonwn Opcode
@@ -18,7 +44,8 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp)
+ FILE *outfp,
+ CPU_INT mode)
{
CPU_UNINT cpu_oldpos;
CPU_INT cpuint;
@@ -37,7 +64,7 @@
if ((cpuint - (cpuint & GetMaskByte32(cpuARMInit_))) ==
ConvertBitToByte32(cpuARMInit_))
{
retsize = ARM_( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
Modified: trunk/rosapps/devutils/cputointel/From/ARM/ARMopcode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/A…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/ARM/ARMopcode.c (original)
+++ trunk/rosapps/devutils/cputointel/From/ARM/ARMopcode.c Sat Jan 13 15:23:25 2007
@@ -16,6 +16,17 @@
* of cpu you whant or do not use it if it does not exists
* other or any sub model.
*
+ * mode : if we should run disambler of this binary or
+ * translate it, Disambler will not calc the
+ * the row name right so we simple give each
+ row a name. In translations mode we run a
+ * analys so we getting better optimzing and
+ * only row name there we need.
+ * value for mode are :
+ * 0 = disambler mode
+ * 1 = translate mode intel
+
+ *
* Return value :
* value -1 : unimplement
* value 0 : wrong opcode or not vaild opcode
@@ -23,7 +34,8 @@
*/
CPU_INT ARM_( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
/*
Modified: trunk/rosapps/devutils/cputointel/From/PPC/PPC.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/P…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/PPC/PPC.h (original)
+++ trunk/rosapps/devutils/cputointel/From/PPC/PPC.h Sat Jan 13 15:23:25 2007
@@ -6,11 +6,12 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp);
+ FILE *outfp,
+ CPU_INT mode);
/* here we put the prototype for the opcode api that brain need we show a example for it
*/
-CPU_INT PPC_Addx(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
+CPU_INT PPC_Addx(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
/* Export comment thing see m68k for example
Modified: trunk/rosapps/devutils/cputointel/From/PPC/PPCBrain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/P…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/PPC/PPCBrain.c (original)
+++ trunk/rosapps/devutils/cputointel/From/PPC/PPCBrain.c Sat Jan 13 15:23:25 2007
@@ -21,6 +21,16 @@
* cpu with same desgin but few other opcode or extend opcode
* outfp : the output file pointer
*
+ * mode : if we should run disambler of this binary or
+ * translate it, Disambler will not calc the
+ * the row name right so we simple give each
+ row a name. In translations mode we run a
+ * analys so we getting better optimzing and
+ * only row name there we need.
+ * value for mode are :
+ * 0 = disambler mode
+ * 1 = translate mode intel
+ *
* return value
* 0 : Ok
* 1 : unimplemt
@@ -34,7 +44,8 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp)
+ FILE *outfp,
+ CPU_INT mode)
{
CPU_UNINT cpu_oldpos;
CPU_INT cpuint;
@@ -53,7 +64,7 @@
if ((cpuint - (cpuint & GetMaskByte32(cpuPPCInit_Addx))) ==
ConvertBitToByte32(cpuPPCInit_Addx))
{
retsize = PPC_Addx( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
Modified: trunk/rosapps/devutils/cputointel/From/PPC/PPCopcode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/P…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/PPC/PPCopcode.c (original)
+++ trunk/rosapps/devutils/cputointel/From/PPC/PPCopcode.c Sat Jan 13 15:23:25 2007
@@ -24,7 +24,8 @@
*/
CPU_INT PPC_Addx( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
/*
Modified: trunk/rosapps/devutils/cputointel/From/dummycpu/Dummy.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/d…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/dummycpu/Dummy.h (original)
+++ trunk/rosapps/devutils/cputointel/From/dummycpu/Dummy.h Sat Jan 13 15:23:25 2007
@@ -6,10 +6,11 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp);
+ FILE *outfp,
+ CPU_INT mode);
/* here we put the prototype for the opcode api that brain need we show a example for it
*/
-CPU_INT DUMMY_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
+CPU_INT DUMMY_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
/* Export comment thing see m68k for example
Modified: trunk/rosapps/devutils/cputointel/From/dummycpu/DummyBrain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/d…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/dummycpu/DummyBrain.c (original)
+++ trunk/rosapps/devutils/cputointel/From/dummycpu/DummyBrain.c Sat Jan 13 15:23:25 2007
@@ -23,6 +23,16 @@
* cpu with same desgin but few other opcode or extend opcode
* outfp : the output file pointer
*
+ * mode : if we should run disambler of this binary or
+ * translate it, Disambler will not calc the
+ * the row name right so we simple give each
+ row a name. In translations mode we run a
+ * analys so we getting better optimzing and
+ * only row name there we need.
+ * value for mode are :
+ * 0 = disambler mode
+ * 1 = translate mode intel
+ *
* return value
* 0 : Ok
* 1 : unimplemt
@@ -36,7 +46,8 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp)
+ FILE *outfp,
+ CPU_INT mode)
{
CPU_UNINT cpu_oldpos;
CPU_INT cpuint;
@@ -54,7 +65,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuDummyInit_Add))) ==
ConvertBitToByte(cpuDummyInit_Add))
{
retsize = DUMMY_Add( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
Modified: trunk/rosapps/devutils/cputointel/From/dummycpu/Dummyopcode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/d…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/dummycpu/Dummyopcode.c (original)
+++ trunk/rosapps/devutils/cputointel/From/dummycpu/Dummyopcode.c Sat Jan 13 15:23:25
2007
@@ -17,6 +17,16 @@
* of cpu you whant or do not use it if it does not exists
* other or any sub model.
*
+ * mode : if we should run disambler of this binary or
+ * translate it, Disambler will not calc the
+ * the row name right so we simple give each
+ row a name. In translations mode we run a
+ * analys so we getting better optimzing and
+ * only row name there we need.
+ * value for mode are :
+ * 0 = disambler mode
+ * 1 = translate mode intel
+ *
* Return value :
* value -1 : unimplement
* value 0 : wrong opcode or not vaild opcode
@@ -24,7 +34,8 @@
*/
CPU_INT DUMMY_Add( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
/*
Modified: trunk/rosapps/devutils/cputointel/From/m68k/M68kBrain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/m…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/m68k/M68kBrain.c (original)
+++ trunk/rosapps/devutils/cputointel/From/m68k/M68kBrain.c Sat Jan 13 15:23:25 2007
@@ -5,7 +5,33 @@
#include "m68k.h"
#include "../../misc.h"
-/* retun
+/*
+ * DummyBrain is example how you create you own cpu brain to translate from
+ * cpu to intel assembler, I have not add DummyBrain to the loader it is not
+ * need it in our example. When you write you own brain, it must be setup in
+ * misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not
+ * need the brain you have writen so you do not need setup it there then.
+ *
+ * input param:
+ * cpu_buffer : the memory buffer with loaded program we whant translate
+ * cpu_pos : the positions in the cpu_buffer
+ * cpu_size : the alloced memory size of the cpu_buffer
+ * BaseAddress : the virtual memory address we setup to use.
+ * cpuarch : the sub arch for the brain, example if it exists more one
+ * cpu with same desgin but few other opcode or extend opcode
+ * outfp : the output file pointer
+ *
+ * mode : if we should run disambler of this binary or
+ * translate it, Disambler will not calc the
+ * the row name right so we simple give each
+ row a name. In translations mode we run a
+ * analys so we getting better optimzing and
+ * only row name there we need.
+ * value for mode are :
+ * 0 = disambler mode
+ * 1 = translate mode intel
+ *
+ * return value
* 0 : Ok
* 1 : unimplemt
* 2 : Unkonwn Opcode
@@ -18,7 +44,8 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp)
+ FILE *outfp,
+ CPU_INT mode)
{
CPU_UNINT cpu_oldpos;
CPU_INT cpuint;
@@ -36,7 +63,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Abcd))) ==
ConvertBitToByte(cpuM68kInit_Abcd))
{
retsize = M68k_Abcd( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -46,7 +73,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Add))) ==
ConvertBitToByte(cpuM68kInit_Add))
{
retsize = M68k_Add( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -56,7 +83,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Addi))) ==
ConvertBitToByte(cpuM68kInit_Addi))
{
retsize = M68k_Addi( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -66,7 +93,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Addq))) ==
ConvertBitToByte(cpuM68kInit_Addq))
{
retsize = M68k_Addq( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -76,7 +103,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Addx))) ==
ConvertBitToByte(cpuM68kInit_Addx))
{
retsize = M68k_Addx( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -86,7 +113,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_And))) ==
ConvertBitToByte(cpuM68kInit_And))
{
retsize = M68k_Add( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -96,7 +123,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Andi))) ==
ConvertBitToByte(cpuM68kInit_Andi))
{
retsize = M68k_Andi( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -110,7 +137,7 @@
{
cpu_pos++;
retsize = M68k_AndToCCR( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -126,7 +153,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bhi))) ==
ConvertBitToByte(cpuM68kInit_Bhi))
{
retsize = M68k_Bhi( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -137,7 +164,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bls))) ==
ConvertBitToByte(cpuM68kInit_Bls))
{
retsize = M68k_Bls( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -148,7 +175,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bcc))) ==
ConvertBitToByte(cpuM68kInit_Bcc))
{
retsize = M68k_Bcc( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -159,7 +186,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bcs))) ==
ConvertBitToByte(cpuM68kInit_Bcs))
{
retsize = M68k_Bcs( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -170,7 +197,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bne))) ==
ConvertBitToByte(cpuM68kInit_Bne))
{
retsize = M68k_Bne( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -181,7 +208,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Beq))) ==
ConvertBitToByte(cpuM68kInit_Beq))
{
retsize = M68k_Beq( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -192,7 +219,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bvc))) ==
ConvertBitToByte(cpuM68kInit_Bvc))
{
retsize = M68k_Bvc( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -203,7 +230,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bvs))) ==
ConvertBitToByte(cpuM68kInit_Bvs))
{
retsize = M68k_Bvs( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -214,7 +241,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bpl))) ==
ConvertBitToByte(cpuM68kInit_Bpl))
{
retsize = M68k_Bpl( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -225,7 +252,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bmi))) ==
ConvertBitToByte(cpuM68kInit_Bmi))
{
retsize = M68k_Bmi( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -236,7 +263,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bge))) ==
ConvertBitToByte(cpuM68kInit_Bge))
{
retsize = M68k_Bge( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -247,7 +274,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Blt))) ==
ConvertBitToByte(cpuM68kInit_Blt))
{
retsize = M68k_Blt( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -258,7 +285,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bgt))) ==
ConvertBitToByte(cpuM68kInit_Bgt))
{
retsize = M68k_Bgt( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
@@ -269,7 +296,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Ble))) ==
ConvertBitToByte(cpuM68kInit_Ble))
{
retsize = M68k_Ble( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch);
+ BaseAddress, cpuarch, mode);
if (retsize<0)
retcode = 1;
else
Modified: trunk/rosapps/devutils/cputointel/From/m68k/M68kopcode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/m…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/m68k/M68kopcode.c (original)
+++ trunk/rosapps/devutils/cputointel/From/m68k/M68kopcode.c Sat Jan 13 15:23:25 2007
@@ -6,7 +6,8 @@
CPU_INT M68k_Abcd( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -15,7 +16,8 @@
}
CPU_INT M68k_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT dismode)
{
CPU_INT opmode;
CPU_INT mode;
@@ -87,7 +89,8 @@
}
CPU_INT M68k_Addi( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -96,7 +99,8 @@
}
CPU_INT M68k_Addq( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -105,7 +109,8 @@
}
CPU_INT M68k_Addx( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -114,7 +119,8 @@
}
CPU_INT M68k_And( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -123,7 +129,8 @@
}
CPU_INT M68k_Andi( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -132,7 +139,8 @@
}
CPU_INT M68k_AndToCCR( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -141,7 +149,8 @@
}
CPU_INT M68k_Asl( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -150,7 +159,8 @@
}
CPU_INT M68k_Asr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -159,7 +169,8 @@
}
CPU_INT M68k_Bhi( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -168,7 +179,8 @@
}
CPU_INT M68k_Bls( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -177,7 +189,8 @@
}
CPU_INT M68k_Bcc( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -186,7 +199,8 @@
}
CPU_INT M68k_Bcs( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -195,7 +209,8 @@
}
CPU_INT M68k_Bne( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -204,7 +219,8 @@
}
CPU_INT M68k_Beq( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -213,7 +229,8 @@
}
CPU_INT M68k_Bvc( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -222,7 +239,8 @@
}
CPU_INT M68k_Bvs( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -231,7 +249,8 @@
}
CPU_INT M68k_Bpl( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -240,7 +259,8 @@
}
CPU_INT M68k_Bmi( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -249,7 +269,8 @@
}
CPU_INT M68k_Bge( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -258,7 +279,8 @@
}
CPU_INT M68k_Blt( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -267,7 +289,8 @@
}
CPU_INT M68k_Bgt( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -276,7 +299,8 @@
}
CPU_INT M68k_Ble( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
+ CPU_INT mode)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
Modified: trunk/rosapps/devutils/cputointel/From/m68k/m68k.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/From/m…
==============================================================================
--- trunk/rosapps/devutils/cputointel/From/m68k/m68k.h (original)
+++ trunk/rosapps/devutils/cputointel/From/m68k/m68k.h Sat Jan 13 15:23:25 2007
@@ -5,33 +5,34 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp);
+ FILE *outfp,
+ CPU_INT mode);
-CPU_INT M68k_Abcd(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Addi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Addq(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Addx(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_And(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Andi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_AndToCCR(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Asl(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Asr(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Bhi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Bls(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Bcc(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Bcs(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Bne(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Beq(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Bvc(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Bvs(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Bpl(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Bmi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Bge(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Blt(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Bgt(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
-CPU_INT M68k_Ble(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
+CPU_INT M68k_Abcd(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Addi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Addq(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Addx(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_And(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Andi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_AndToCCR(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Asl(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Asr(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Bhi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Bls(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Bcc(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Bcs(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Bne(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Beq(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Bvc(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Bvs(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Bpl(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Bmi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Bge(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Blt(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Bgt(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
+CPU_INT M68k_Ble(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch, CPU_INT mode);
extern CPU_BYTE M68k_Rx[16];
extern CPU_BYTE M68k_RM[16];
Modified: trunk/rosapps/devutils/cputointel/ImageLoader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/ImageL…
==============================================================================
--- trunk/rosapps/devutils/cputointel/ImageLoader.c (original)
+++ trunk/rosapps/devutils/cputointel/ImageLoader.c Sat Jan 13 15:23:25 2007
@@ -10,12 +10,19 @@
#include "From/PPC/PPC.h"
/*
- *
+ * infileName file name to convert or disambler
+ * outputfileName file name to save to
+ * BaseAddress the address we should emulate
+ * cpuid the cpu we choice not vaild for pe loader
+ * type the loading mode Auto, PE, bin
+ * mode disambler mode : 0 the arch cpu.
+ * translate mode : 1 intel
+ *
*/
CPU_INT LoadPFileImage( char *infileName, char *outputfileName,
CPU_UNINT BaseAddress, char *cpuid,
- CPU_UNINT type)
+ CPU_UNINT type, CPU_INT mode)
{
FILE *infp;
FILE *outfp;
@@ -102,7 +109,7 @@
if (type==0)
{
- if ( PEFileStart(cpu_buffer, 0, BaseAddress, cpu_size, outfp) !=0)
+ if ( PEFileStart(cpu_buffer, 0, BaseAddress, cpu_size, outfp, mode) !=0)
{
type=1;
}
@@ -111,24 +118,24 @@
if (type== 1)
{
if (stricmp(cpuid,"m68000"))
- return M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68000,outfp);
+ return
M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68000,outfp,mode);
else if (stricmp(cpuid,"m68010"))
- return M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68010,outfp);
+ return
M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68010,outfp,mode);
else if (stricmp(cpuid,"m68020"))
- return M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68020,outfp);
+ return
M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68020,outfp,mode);
else if (stricmp(cpuid,"m68030"))
- return M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68030,outfp);
+ return
M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68030,outfp,mode);
else if (stricmp(cpuid,"m68040"))
- return M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68040,outfp);
+ return
M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68040,outfp,mode);
else if (stricmp(cpuid,"ppc"))
- return PPCBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,0,outfp);
+ return PPCBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,0,outfp,mode);
else if (stricmp(cpuid,"arm4"))
- return ARMBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,4,outfp);
+ return ARMBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,4,outfp,mode);
}
if (type==2)
{
- return PEFileStart(cpu_buffer, 0, BaseAddress, cpu_size, outfp);
+ return PEFileStart(cpu_buffer, 0, BaseAddress, cpu_size, outfp, mode);
}
@@ -137,7 +144,7 @@
CPU_INT PEFileStart( CPU_BYTE *memory, CPU_UNINT pos,
CPU_UNINT base, CPU_UNINT size,
- FILE *outfp)
+ FILE *outfp, CPU_INT mode)
{
PIMAGE_DOS_HEADER DosHeader;
PIMAGE_NT_HEADERS NtHeader;
@@ -329,7 +336,7 @@
case IMAGE_FILE_MACHINE_POWERPC:
printf("CPU POWERPC Detected no CPUBrain implement for
it\n");
//PPCBrain(memory, pos, cpu_size, base, 0, outfp);
- return PPCBrain(memory+SectionHeader->PointerToRawData, 0,
SectionHeader->SizeOfRawData, 0, 0, outfp);
+ return PPCBrain(memory+SectionHeader->PointerToRawData, 0,
SectionHeader->SizeOfRawData, 0, 0, outfp,mode);
return 3;
Modified: trunk/rosapps/devutils/cputointel/misc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/misc.h…
==============================================================================
--- trunk/rosapps/devutils/cputointel/misc.h (original)
+++ trunk/rosapps/devutils/cputointel/misc.h Sat Jan 13 15:23:25 2007
@@ -11,8 +11,8 @@
#define CPU_BYTE unsigned char
/* Prototypes for misc stuff */
-CPU_INT LoadPFileImage(char *infileName, char *outputfileName, CPU_UNINT BaseAddress,
char *cpuid, CPU_UNINT type);
-CPU_INT PEFileStart( CPU_BYTE *memory, CPU_UNINT pos, CPU_UNINT base, CPU_UNINT size,
FILE *outfp);
+CPU_INT LoadPFileImage(char *infileName, char *outputfileName, CPU_UNINT BaseAddress,
char *cpuid, CPU_UNINT type, CPU_INT mode);
+CPU_INT PEFileStart( CPU_BYTE *memory, CPU_UNINT pos, CPU_UNINT base, CPU_UNINT size,
FILE *outfp, CPU_INT mode);
CPU_UNINT ConvertBitToByte(CPU_BYTE *bit);
CPU_UNINT GetMaskByte(CPU_BYTE *bit);