Author: greatlrd
Date: Wed Jan 17 20:35:18 2007
New Revision: 25498
URL:
http://svn.reactos.org/svn/reactos?rev=25498&view=rev
Log:
Adding m68k,arm,ia32,ppc to ppc convert.
Remove the old disambler list from ppc to ppc
implement new ppc to ppc disambler that are allot better at end.
Modified:
trunk/rosapps/devutils/cputointel/ConvertToIA32Process.c
trunk/rosapps/devutils/cputointel/ConvertingProcess.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/any_op.h
trunk/rosapps/devutils/cputointel/cputointel.rbuild
Modified: trunk/rosapps/devutils/cputointel/ConvertToIA32Process.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/Conver…
==============================================================================
--- trunk/rosapps/devutils/cputointel/ConvertToIA32Process.c (original)
+++ trunk/rosapps/devutils/cputointel/ConvertToIA32Process.c Wed Jan 17 20:35:18 2007
@@ -8,7 +8,7 @@
#include "misc.h"
#include "any_op.h"
-CPU_INT ConvertToIntelProcess( FILE *outfp, CPU_INT eax, CPU_INT ebp,
+CPU_INT ConvertToIA32Process( FILE *outfp, CPU_INT eax, CPU_INT ebp,
CPU_INT edx, CPU_INT esp,
PMYBrainAnalys pMystart,
PMYBrainAnalys pMyend, CPU_INT regbits,
@@ -109,7 +109,7 @@
fprintf(outfp,"mov dword [ebx - %d], %llu\n", tmp,
pMystart->src);
else
{
- fprintf(outfp,"unsuported optimze should not happen it
happen :(\n", tmp, pMystart->src);
+ fprintf(outfp,"unsuported optimze should not happen it
happen :(\n");
}
}
}
Modified: trunk/rosapps/devutils/cputointel/ConvertingProcess.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/Conver…
==============================================================================
--- trunk/rosapps/devutils/cputointel/ConvertingProcess.c (original)
+++ trunk/rosapps/devutils/cputointel/ConvertingProcess.c Wed Jan 17 20:35:18 2007
@@ -50,7 +50,20 @@
switch (ToCpuid)
{
case IMAGE_FILE_MACHINE_I386:
- ret = ConvertToIntelProcess( outfp, eax, ebp,
+ ret = ConvertToIA32Process( outfp, eax, ebp,
+ edx, esp,
+ pMystart,
+ pMyend, regbits,
+ HowManyRegInUse);
+ if (ret !=0)
+ {
+ printf("should not happen contact a devloper, x86 fail\n");
+ return -1;
+ }
+ break;
+
+ case IMAGE_FILE_MACHINE_POWERPC:
+ ret = ConvertToPPCProcess( outfp, eax, ebp,
edx, esp,
pMystart,
pMyend, regbits,
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 Wed Jan 17 20:35:18 2007
@@ -6,11 +6,10 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp,
- CPU_INT mode);
+ FILE *outfp);
/* 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 mode);
+CPU_INT ARM_(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
/* 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 Wed Jan 17 20:35:18 2007
@@ -44,8 +44,7 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp,
- CPU_INT mode)
+ FILE *outfp)
{
CPU_UNINT cpu_oldpos;
CPU_INT cpuint;
@@ -64,7 +63,7 @@
if ((cpuint - (cpuint & GetMaskByte32(cpuARMInit_))) ==
ConvertBitToByte32(cpuARMInit_))
{
retsize = ARM_( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
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 Wed Jan 17 20:35:18 2007
@@ -34,8 +34,7 @@
*/
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)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
/*
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 Wed Jan 17 20:35:18 2007
@@ -6,14 +6,13 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp,
- CPU_INT mode);
+ FILE *outfp);
/* 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 mode);
-CPU_INT PPC_Blr( 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 PPC_Ld( 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 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_Blr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
+CPU_INT PPC_Ld( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size,
CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
/* Export comment thing see m68k for example
* in dummy we do not show it, for it is diffent for each cpu
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 Wed Jan 17 20:35:18 2007
@@ -44,8 +44,7 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp,
- CPU_INT mode)
+ FILE *outfp)
{
CPU_UNINT cpu_oldpos;
CPU_INT cpuint;
@@ -64,7 +63,7 @@
if ((cpuint - (cpuint & GetMaskByte32(cpuPPCInit_Ld))) ==
ConvertBitToByte32(cpuPPCInit_Ld))
{
retsize = PPC_Ld( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -75,7 +74,7 @@
if ((cpuint - (cpuint & GetMaskByte32(cpuPPCInit_Blr))) ==
ConvertBitToByte32(cpuPPCInit_Blr))
{
retsize = PPC_Blr( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
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 Wed Jan 17 20:35:18 2007
@@ -30,34 +30,25 @@
CPU_INT PPC_Blr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
- CPU_INT mode)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
BaseAddress +=cpu_pos;
- if (mode==0)
+
+ /* own translatons langues */
+ if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */
{
- fprintf(out,"Line_0x%08x:\n",BaseAddress);
- fprintf(out,"blr\n");
+ return -1;
}
- else if (mode>0)
- {
- /* own translatons langues */
- if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */
- {
- return -1;
- }
- pMyBrainAnalys->op = OP_ANY_ret;
- pMyBrainAnalys->memAdr=BaseAddress;
- }
+ pMyBrainAnalys->op = OP_ANY_ret;
+ pMyBrainAnalys->memAdr=BaseAddress;
return 4;
}
CPU_INT PPC_Ld( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
- CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch,
- CPU_INT mode)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
CPU_UNINT formA;
CPU_UNINT formD;
@@ -75,25 +66,18 @@
}
BaseAddress +=cpu_pos;
- if (mode==0)
+
+ /* own translatons langues */
+ if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */
{
- fprintf(out,"Line_0x%08x:\n",BaseAddress);
- fprintf(out,"li %%r%d,%d\n",formA, formDS);
+ return -1;
}
- else if (mode>0)
- {
- /* own translatons langues */
- if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */
- {
- return -1;
- }
- pMyBrainAnalys->op = OP_ANY_mov;
- pMyBrainAnalys->type= 8 + 16; /* 8 dst reg, 16 imm */
- pMyBrainAnalys->src_size = 16;
- pMyBrainAnalys->src = formDS;
- pMyBrainAnalys->dst = formA;
- pMyBrainAnalys->memAdr=BaseAddress;
- }
+ pMyBrainAnalys->op = OP_ANY_mov;
+ pMyBrainAnalys->type= 8 + 16; /* 8 dst reg, 16 imm */
+ pMyBrainAnalys->src_size = 16;
+ pMyBrainAnalys->src = formDS;
+ pMyBrainAnalys->dst = formA;
+ pMyBrainAnalys->memAdr=BaseAddress;
return 4;
}
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 Wed Jan 17 20:35:18 2007
@@ -6,11 +6,10 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp,
- CPU_INT mode);
+ FILE *outfp);
/* 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 mode);
+CPU_INT DUMMY_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT
cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
/* 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 Wed Jan 17 20:35:18 2007
@@ -23,16 +23,6 @@
* 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
@@ -46,8 +36,7 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp,
- CPU_INT mode)
+ FILE *outfp)
{
CPU_UNINT cpu_oldpos;
CPU_INT cpuint;
@@ -71,7 +60,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuDummyInit_Add))) ==
ConvertBitToByte(cpuDummyInit_Add))
{
retsize = DUMMY_Add( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
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 Wed Jan 17 20:35:18
2007
@@ -16,17 +16,6 @@
* pentinum-mmx so on, use this flag to specify which type
* 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
@@ -34,8 +23,7 @@
*/
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)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
/*
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 Wed Jan 17 20:35:18 2007
@@ -21,16 +21,6 @@
* 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
@@ -44,8 +34,7 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp,
- CPU_INT mode)
+ FILE *outfp)
{
CPU_UNINT cpu_oldpos;
CPU_INT cpuint;
@@ -63,7 +52,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Abcd))) ==
ConvertBitToByte(cpuM68kInit_Abcd))
{
retsize = M68k_Abcd( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -73,7 +62,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Add))) ==
ConvertBitToByte(cpuM68kInit_Add))
{
retsize = M68k_Add( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -83,7 +72,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Addi))) ==
ConvertBitToByte(cpuM68kInit_Addi))
{
retsize = M68k_Addi( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -93,7 +82,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Addq))) ==
ConvertBitToByte(cpuM68kInit_Addq))
{
retsize = M68k_Addq( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -103,7 +92,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Addx))) ==
ConvertBitToByte(cpuM68kInit_Addx))
{
retsize = M68k_Addx( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -113,7 +102,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_And))) ==
ConvertBitToByte(cpuM68kInit_And))
{
retsize = M68k_Add( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -123,7 +112,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Andi))) ==
ConvertBitToByte(cpuM68kInit_Andi))
{
retsize = M68k_Andi( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -137,7 +126,7 @@
{
cpu_pos++;
retsize = M68k_AndToCCR( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -153,7 +142,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bhi))) ==
ConvertBitToByte(cpuM68kInit_Bhi))
{
retsize = M68k_Bhi( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -164,7 +153,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bls))) ==
ConvertBitToByte(cpuM68kInit_Bls))
{
retsize = M68k_Bls( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -175,7 +164,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bcc))) ==
ConvertBitToByte(cpuM68kInit_Bcc))
{
retsize = M68k_Bcc( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -186,7 +175,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bcs))) ==
ConvertBitToByte(cpuM68kInit_Bcs))
{
retsize = M68k_Bcs( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -197,7 +186,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bne))) ==
ConvertBitToByte(cpuM68kInit_Bne))
{
retsize = M68k_Bne( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -208,7 +197,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Beq))) ==
ConvertBitToByte(cpuM68kInit_Beq))
{
retsize = M68k_Beq( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -219,7 +208,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bvc))) ==
ConvertBitToByte(cpuM68kInit_Bvc))
{
retsize = M68k_Bvc( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -230,7 +219,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bvs))) ==
ConvertBitToByte(cpuM68kInit_Bvs))
{
retsize = M68k_Bvs( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -241,7 +230,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bpl))) ==
ConvertBitToByte(cpuM68kInit_Bpl))
{
retsize = M68k_Bpl( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -252,7 +241,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bmi))) ==
ConvertBitToByte(cpuM68kInit_Bmi))
{
retsize = M68k_Bmi( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -263,7 +252,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bge))) ==
ConvertBitToByte(cpuM68kInit_Bge))
{
retsize = M68k_Bge( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -274,7 +263,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Blt))) ==
ConvertBitToByte(cpuM68kInit_Blt))
{
retsize = M68k_Blt( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -285,7 +274,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bgt))) ==
ConvertBitToByte(cpuM68kInit_Bgt))
{
retsize = M68k_Bgt( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
if (retsize<0)
retcode = 1;
else
@@ -296,7 +285,7 @@
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Ble))) ==
ConvertBitToByte(cpuM68kInit_Ble))
{
retsize = M68k_Ble( outfp, cpu_buffer, cpu_pos, cpu_size,
- BaseAddress, cpuarch, mode);
+ BaseAddress, cpuarch);
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 Wed Jan 17 20:35:18 2007
@@ -6,8 +6,7 @@
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -16,8 +15,7 @@
}
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 dismode)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
CPU_INT opmode;
CPU_INT mode;
@@ -89,8 +87,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -99,8 +96,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -109,8 +105,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -119,8 +114,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -129,8 +123,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -139,8 +132,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -149,8 +141,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -159,8 +150,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -169,8 +159,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -179,8 +168,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -189,8 +177,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -199,8 +186,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -209,8 +195,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -219,8 +204,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -229,8 +213,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -239,8 +222,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -249,8 +231,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -259,8 +240,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -269,8 +249,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -279,8 +258,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -289,8 +267,7 @@
}
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_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
@@ -299,8 +276,7 @@
}
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)
+ CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
{
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 Wed Jan 17 20:35:18 2007
@@ -5,34 +5,33 @@
CPU_UNINT cpu_size,
CPU_UNINT BaseAddress,
CPU_UNINT cpuarch,
- FILE *outfp,
- CPU_INT mode);
+ FILE *outfp);
-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);
+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);
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 Wed Jan 17 20:35:18 2007
@@ -10,8 +10,8 @@
#include "From/PPC/PPC.h"
static CPU_INT machine_type = 0;
-static CPU_INT ToMachine_type = IMAGE_FILE_MACHINE_I386;
-
+//static CPU_INT ToMachine_type = IMAGE_FILE_MACHINE_I386;
+static CPU_INT ToMachine_type = IMAGE_FILE_MACHINE_POWERPC;
/*
* infileName file name to convert or disambler
* outputfileName file name to save to
@@ -20,8 +20,42 @@
* type the loading mode Auto, PE, bin
* mode disambler mode : 0 the arch cpu.
* translate mode : 1 intel
+ * translate mode : 2 ppc
*
*/
+
+static void SetCPU(CPU_INT FromCpu, CPU_INT mode)
+{
+ machine_type = FromCpu;
+ switch(mode)
+ {
+ case 0:
+ ToMachine_type = machine_type;
+ break;
+
+ case 1:
+ ToMachine_type = IMAGE_FILE_MACHINE_I386;
+ break;
+
+ case 2:
+ ToMachine_type = IMAGE_FILE_MACHINE_POWERPC;
+ break;
+
+ default:
+ printf("Not supported mode\n");
+ break;
+
+ }
+}
+
+static void Convert(FILE *outfp, CPU_INT FromCpu, CPU_INT mode)
+{
+ SetCPU(machine_type,mode);
+ AnyalsingProcess();
+ ConvertProcess(outfp, machine_type, ToMachine_type);
+ FreeAny();
+}
+
CPU_INT LoadPFileImage( char *infileName, char *outputfileName,
CPU_UNINT BaseAddress, char *cpuid,
@@ -121,9 +155,7 @@
{
if (mode > 0)
{
- AnyalsingProcess();
- ConvertProcess(outfp, machine_type, ToMachine_type);
- FreeAny();
+ Convert(outfp,machine_type,mode);
}
fclose(outfp);
return 0;
@@ -134,83 +166,69 @@
{
if (stricmp(cpuid,"m68000"))
{
- ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68000,outfp,mode);
- if (mode > 1)
- {
- AnyalsingProcess();
- ConvertProcess(outfp, machine_type, ToMachine_type);
- FreeAny();
+ ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68000,outfp);
+ if (mode > 1)
+ {
+ Convert(outfp,machine_type,mode);
}
fclose(outfp);
}
else if (stricmp(cpuid,"m68010"))
{
- ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68010,outfp,mode);
- if (mode > 1)
- {
- AnyalsingProcess();
- ConvertProcess(outfp, machine_type, ToMachine_type);
- FreeAny();
+ ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68010,outfp);
+ if (mode > 1)
+ {
+ Convert(outfp,machine_type,mode);
}
fclose(outfp);
return ret;
}
else if (stricmp(cpuid,"m68020"))
{
- ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68020,outfp,mode);
- if (mode > 1)
- {
- AnyalsingProcess();
- ConvertProcess(outfp, machine_type, ToMachine_type);
- FreeAny();
+ ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68020,outfp);
+ if (mode > 1)
+ {
+ Convert(outfp,machine_type,mode);
}
fclose(outfp);
return ret;
}
else if (stricmp(cpuid,"m68030"))
{
- ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68030,outfp,mode);
- if (mode > 1)
- {
- AnyalsingProcess();
- ConvertProcess(outfp, machine_type, ToMachine_type);
- FreeAny();
+ ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68030,outfp);
+ if (mode > 1)
+ {
+ Convert(outfp,machine_type,mode);
}
fclose(outfp);
return ret;
}
else if (stricmp(cpuid,"m68040"))
{
- ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68040,outfp,mode);
- if (mode > 1)
- {
- AnyalsingProcess();
- ConvertProcess(outfp, machine_type, ToMachine_type);
- FreeAny();
+ ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68040,outfp);
+ if (mode > 1)
+ {
+ Convert(outfp,machine_type,mode);
}
fclose(outfp);
return ret;
}
else if (stricmp(cpuid,"ppc"))
{
- ret = PPCBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,0,outfp,mode);
- if (mode > 1)
- {
- AnyalsingProcess();
- ConvertProcess(outfp, machine_type, ToMachine_type);
- FreeAny();
+ ret = PPCBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,0,outfp);
+ if (mode > 1)
+ {
+ Convert(outfp,machine_type,mode);
}
fclose(outfp);
return ret;
}
else if (stricmp(cpuid,"arm4"))
{
- ret = ARMBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,4,outfp,mode);
- if (mode > 1)
- {
- AnyalsingProcess();
- ConvertProcess(outfp, machine_type, ToMachine_type);
- FreeAny();
+ ret = ARMBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,4,outfp);
+ if (mode > 1)
+ {
+ Convert(outfp,machine_type,mode);
}
fclose(outfp);
return ret;
@@ -223,9 +241,7 @@
ret = PEFileStart(cpu_buffer, 0, BaseAddress, cpu_size, outfp, mode);
if (mode > 1)
{
- AnyalsingProcess();
- ConvertProcess(outfp, machine_type, ToMachine_type);
- FreeAny();
+ Convert(outfp,machine_type,mode);
}
fclose(outfp);
return ret;
@@ -466,7 +482,7 @@
fprintf(outfp,"; CPU found POWERPC\n");
//PPCBrain(memory, pos, cpu_size, base, 0, outfp);
machine_type = IMAGE_FILE_MACHINE_POWERPC;
- return PPCBrain(memory+SectionHeader->PointerToRawData, 0,
SectionHeader->SizeOfRawData, 0, 0, outfp,mode);
+ return PPCBrain(memory+SectionHeader->PointerToRawData, 0,
SectionHeader->SizeOfRawData, 0, 0, outfp);
case IMAGE_FILE_MACHINE_POWERPCFP:
Modified: trunk/rosapps/devutils/cputointel/any_op.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/any_op…
==============================================================================
--- trunk/rosapps/devutils/cputointel/any_op.h (original)
+++ trunk/rosapps/devutils/cputointel/any_op.h Wed Jan 17 20:35:18 2007
@@ -4,6 +4,13 @@
#define OP_ANY_mov 0x00000000
#define OP_ANY_ret 0x00000001
+
+/* We are using same abi as PPC
+ * eax = register 3
+ * edx = register 4
+ * esp = register 1
+ * ebp = register 31
+ */
typedef struct _BrainAnalys
{
@@ -33,10 +40,16 @@
extern PMYBrainAnalys pMyBrainAnalys; /* current working address */
extern PMYBrainAnalys pStartMyBrainAnalys; /* start address */
-CPU_INT ConvertToIntelProcess( FILE *outfp, CPU_INT eax, CPU_INT ebp,
+CPU_INT ConvertToIA32Process( FILE *outfp, CPU_INT eax, CPU_INT ebp,
CPU_INT edx, CPU_INT esp,
PMYBrainAnalys pMystart,
PMYBrainAnalys pMyend, CPU_INT regbits,
CPU_INT HowManyRegInUse);
+CPU_INT ConvertToPPCProcess( FILE *outfp, CPU_INT r3, CPU_INT r31,
+ CPU_INT r4, CPU_INT r1,
+ PMYBrainAnalys pMystart,
+ PMYBrainAnalys pMyend, CPU_INT regbits,
+ CPU_INT HowManyRegInUse);
+
#endif
Modified: trunk/rosapps/devutils/cputointel/cputointel.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/devutils/cputointel/cputoi…
==============================================================================
--- trunk/rosapps/devutils/cputointel/cputointel.rbuild (original)
+++ trunk/rosapps/devutils/cputointel/cputointel.rbuild Wed Jan 17 20:35:18 2007
@@ -28,5 +28,7 @@
<file>AnyalsingProcess.c</file>
<file>ConvertingProcess.c</file>
<file>ConvertToIA32Process.c</file>
+ <file>ConvertToPPCProcess.c</file>
+
</module>