Release 950727
[wine] / include / registers.h
1 #ifndef __WINE_REGISTERS_H
2 #define __WINE_REGISTERS_H
3
4 #include <windows.h>
5
6 #ifndef PROCEMU
7
8 #include "wine.h"
9
10 #define EAX (context->sc_eax)
11 #define EBX (context->sc_ebx)
12 #define ECX (context->sc_ecx)
13 #define EDX (context->sc_edx)
14 #define ESI (context->sc_esi)
15 #define EDI (context->sc_edi)
16 #define EBP (context->sc_ebp)
17
18 #define AX (*(WORD*)&context->sc_eax)
19 #define BX (*(WORD*)&context->sc_ebx)
20 #define CX (*(WORD*)&context->sc_ecx)
21 #define DX (*(WORD*)&context->sc_edx)
22 #define SI (*(WORD*)&context->sc_esi)
23 #define DI (*(WORD*)&context->sc_edi)
24 #define BP (*(WORD*)&context->sc_ebp)
25
26 #define AL (*(BYTE*)&context->sc_eax)
27 #define AH (*(((BYTE*)&context->sc_eax)+1))
28 #define BL (*(BYTE*)&context->sc_ebx)
29 #define BH (*(((BYTE*)&context->sc_ebx)+1))
30 #define CL (*(BYTE*)&context->sc_ecx)
31 #define CH (*(((BYTE*)&context->sc_ecx)+1))
32 #define DL (*(BYTE*)&context->sc_edx)
33 #define DH (*(((BYTE*)&context->sc_edx)+1))
34
35 #define CS (context->sc_cs)
36 #define DS (context->sc_ds)
37 #define ES (context->sc_es)
38 #define SS (context->sc_ss)
39
40 #ifdef linux
41 #define FS (context->sc_fs)
42 #define GS (context->sc_gs)
43 #else  /* FIXME: are fs and gs supported under *BSD? */
44 #define FS  0
45 #define GS  0
46 #endif
47
48 #ifndef __FreeBSD__
49 #define EFL (context->sc_eflags)
50 #define FL (*(WORD*)&context->sc_eflags)
51 #else
52 #define EFL (context->sc_efl)
53 #define FL (*(WORD*)&context->sc_efl)
54 #endif
55
56 #define EIP (context->sc_eip)
57 #define ESP (context->sc_esp)
58
59 #define IP  (*(WORD*)&context->sc_eip)
60 #define SP  (*(WORD*)&context->sc_esp)
61
62 #define SetCflag        (EFL |= 0x00000001)
63 #define ResetCflag      (EFL &= 0xfffffffe)
64
65 #else
66
67 #include "bx_bochs.h"
68
69 #define SetCflag        bx_STC()
70 #define ResetCflag      bx_CLC()
71
72 #endif /* PROCEMU */
73 #endif /* __WINE_REGISTERS_H */