initate work of a CPUtranslator, example M68k to Intel. it is writen so not only M68k can be added. it does not work at all. it is a ground layout how I should code it.

svn path=/trunk/; revision=25251
This commit is contained in:
Magnus Olsen 2006-12-31 14:59:07 +00:00
parent 1282be6796
commit 39436f3008
8 changed files with 492 additions and 0 deletions

View file

@ -0,0 +1,34 @@
#include <stdio.h>
#include "misc.h"
/* Conveting bit array to a int byte */
CPU_UNINT ConvertBitToByte(CPU_BYTE *bit)
{
CPU_UNINT Byte = 0;
CPU_UNINT t;
for(t=15;t>0;t--)
{
if (bit[15-t] != 2)
Byte = Byte + (bit[15-t]<<t);
}
return Byte;
}
/* Conveting bit array mask to a int byte mask */
CPU_UNINT GetMaskByte(CPU_BYTE *bit)
{
CPU_UNINT MaskByte = 0;
CPU_UNINT t;
for(t=15;t>0;t--)
{
if (bit[15-t] == 2)
{
MaskByte = MaskByte + ( (bit[15-t]-1) <<t);
}
}
return MaskByte;
}