mirror of
https://github.com/reactos/reactos.git
synced 2025-08-01 17:03:00 +00:00
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:
parent
1282be6796
commit
39436f3008
8 changed files with 492 additions and 0 deletions
34
rosapps/devutils/cputointel/misc.c
Normal file
34
rosapps/devutils/cputointel/misc.c
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue