From 0cb4e210e1d41aaabaa75f233e7c129dab802f83 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Thu, 18 Jan 2007 22:09:08 +0000 Subject: [PATCH] Fixing another bug in converting PPC stwu r1,-32(r1) equal with intel mov [esp-32],esp; mov esp, esp - 32; svn path=/trunk/; revision=25518 --- .../devutils/cputointel/ConvertToIA32Process.c | 15 ++++++++++++++- rosapps/devutils/cputointel/From/PPC/PPCopcode.c | 2 +- rosapps/devutils/cputointel/any_op.h | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/rosapps/devutils/cputointel/ConvertToIA32Process.c b/rosapps/devutils/cputointel/ConvertToIA32Process.c index 51cde7afefa..b2a8bd0f229 100644 --- a/rosapps/devutils/cputointel/ConvertToIA32Process.c +++ b/rosapps/devutils/cputointel/ConvertToIA32Process.c @@ -190,7 +190,7 @@ CPU_INT ConvertToIA32Process( FILE *outfp, { /* dest [eax - 0x20], source reg */ - fprintf(outfp,"mov ["); + fprintf(outfp,"mov dword ["); standardreg( RegTableCount, pMystart->dst, setup_ebp, outfp); @@ -199,6 +199,19 @@ CPU_INT ConvertToIA32Process( FILE *outfp, pMystart->src, setup_ebp, outfp); fprintf(outfp,"\n"); + + if ((pMystart->type & 128)== 128) + { + fprintf(outfp,"mov "); + standardreg( RegTableCount, + pMystart->src, + setup_ebp, outfp); + fprintf(outfp," , "); + standardreg( RegTableCount, + pMystart->dst, + setup_ebp, outfp); + fprintf(outfp," %d\n",pMystart->dst_extra); + } } } diff --git a/rosapps/devutils/cputointel/From/PPC/PPCopcode.c b/rosapps/devutils/cputointel/From/PPC/PPCopcode.c index 3f9df067e9d..30ccea811a5 100644 --- a/rosapps/devutils/cputointel/From/PPC/PPCopcode.c +++ b/rosapps/devutils/cputointel/From/PPC/PPCopcode.c @@ -116,7 +116,7 @@ CPU_INT PPC_Stwu( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, tmp = _byteswap_ushort( ((CPU_SHORT)((opcode >> 16) & 0xffff))); pMyBrainAnalys->op = OP_ANY_mov; - pMyBrainAnalys->type= 2 + 64; + pMyBrainAnalys->type= 2 + 64 + 128; pMyBrainAnalys->src_size = 32; pMyBrainAnalys->dst_size = 32; pMyBrainAnalys->src = PPC_GetBitArrayBto31xx(opcode); diff --git a/rosapps/devutils/cputointel/any_op.h b/rosapps/devutils/cputointel/any_op.h index 4ebf1e119d2..0178aa7f320 100644 --- a/rosapps/devutils/cputointel/any_op.h +++ b/rosapps/devutils/cputointel/any_op.h @@ -33,6 +33,7 @@ typedef struct _BrainAnalys /* 16 = source are imm */ /* 32 = soucre -xx(r1) or [eax-xx] */ /* 64 = dest -xx(r1) or [eax-xx] */ + /* 128 = update form the src be update with dest */ CPU_INT src_size; /* who many bits are src not vaild for reg*/ CPU_INT dst_size; /* who many bits are dst not vaild for reg*/