- Italian translation by Daniele Forsi (dforsi at gmail dot com)
[reactos.git] / rosapps / devutils / cputointel / any_op.h
1
2 #ifndef __ANY_OP_H__
3 #define __ANY_OP_H__
4
5 #define OP_ANY_mov 0x00000000
6 #define OP_ANY_ret 0x00000001
7
8 /* We are using same abi as PPC
9 * eax = register 3
10 * edx = register 4
11 * esp = register 1
12 * ebp = register 31
13
14 * ecx = 8
15 * ebx = 9
16 * esi = 10
17 * edi = 11
18 * mmx/sse/fpu 0 = 12
19 * mmx/sse/fpu 1 = 14
20 * mmx/sse/fpu 2 = 16
21 * mmx/sse/fpu 3 = 18
22 * mmx/sse/fpu 4 = 20
23 * mmx/sse/fpu 5 = 22
24 * mmx/sse/fpu 6 = 24
25 * mmx/sse/fpu 7 = 28
26 */
27
28 typedef struct _BrainAnalys
29 {
30 CPU_UNINT op; /* one tranlator for any cpu type set our own opcode */
31 CPU_INT type; /* 1 = source are memmory, 2 source are register */
32 /* 4 = dest are memmory, 8 dest are register */
33 /* 16 = source are imm */
34 /* 32 = soucre -xx(r1) or [eax-xx] */
35 /* 64 = dest -xx(r1) or [eax-xx] */
36 /* 128 = update form the src be update with dest */
37
38 CPU_INT src_size; /* who many bits are src not vaild for reg*/
39 CPU_INT dst_size; /* who many bits are dst not vaild for reg*/
40
41 CPU_UNINT64 src;
42 CPU_UNINT64 dst;
43
44 CPU_INT src_extra; /* if type == 32 are set */
45 CPU_INT dst_extra; /* if type == 32 are set */
46
47 CPU_UNINT memAdr; /* where are we in the current memory pos + baseaddress */
48
49 CPU_INT row; /* 0 = no row,
50 * 1 = row is bcc (conditions),
51 * 2 = row is jsr (Call)
52 */
53
54 /* try translate the Adress to a name */
55 CPU_BYTE* ptr_next; /* hook next one */
56 CPU_BYTE* ptr_prev; /* hook previus one */
57 } MYBrainAnalys, *PMYBrainAnalys;
58
59 extern PMYBrainAnalys pMyBrainAnalys; /* current working address */
60 extern PMYBrainAnalys pStartMyBrainAnalys; /* start address */
61
62 CPU_INT ConvertToIA32Process( FILE *outfp,
63 PMYBrainAnalys pMystart,
64 PMYBrainAnalys pMyend, CPU_INT regbits,
65 CPU_INT HowManyRegInUse,
66 CPU_INT *RegTableCount);
67
68 CPU_INT ConvertToPPCProcess( FILE *outfp,
69 PMYBrainAnalys pMystart,
70 PMYBrainAnalys pMyend, CPU_INT regbits,
71 CPU_INT HowManyRegInUse,
72 CPU_INT *RegTableCount);
73
74 #endif