Release 951003
[wine/multimedia.git] / include / registers.h
blob777522d9ab0b336bfbccaf02aae50b6910633378
1 /*
2 * Register definitions
4 * Copyright 1995 Alexandre Julliard
5 */
7 #ifndef __WINE_REGISTERS_H
8 #define __WINE_REGISTERS_H
10 #include <windows.h>
11 #include "wine.h"
13 #define EAX_reg(context) ((context)->sc_eax)
14 #define EBX_reg(context) ((context)->sc_ebx)
15 #define ECX_reg(context) ((context)->sc_ecx)
16 #define EDX_reg(context) ((context)->sc_edx)
17 #define ESI_reg(context) ((context)->sc_esi)
18 #define EDI_reg(context) ((context)->sc_edi)
19 #define EBP_reg(context) ((context)->sc_ebp)
21 #define AX_reg(context) (*(WORD*)&((context)->sc_eax))
22 #define BX_reg(context) (*(WORD*)&((context)->sc_ebx))
23 #define CX_reg(context) (*(WORD*)&((context)->sc_ecx))
24 #define DX_reg(context) (*(WORD*)&((context)->sc_edx))
25 #define SI_reg(context) (*(WORD*)&((context)->sc_esi))
26 #define DI_reg(context) (*(WORD*)&((context)->sc_edi))
27 #define BP_reg(context) (*(WORD*)&((context)->sc_ebp))
29 #define AL_reg(context) (*(BYTE*)(&(context)->sc_eax))
30 #define AH_reg(context) (*(((BYTE*)(&(context)->sc_eax)+1)))
31 #define BL_reg(context) (*(BYTE*)(&(context)->sc_ebx))
32 #define BH_reg(context) (*(((BYTE*)(&(context)->sc_ebx)+1)))
33 #define CL_reg(context) (*(BYTE*)(&(context)->sc_ecx))
34 #define CH_reg(context) (*(((BYTE*)(&(context)->sc_ecx)+1)))
35 #define DL_reg(context) (*(BYTE*)(&(context)->sc_edx))
36 #define DH_reg(context) (*(((BYTE*)(&(context)->sc_edx)+1)))
38 #define CS_reg(context) ((context)->sc_cs)
39 #define DS_reg(context) ((context)->sc_ds)
40 #define ES_reg(context) ((context)->sc_es)
41 #define SS_reg(context) ((context)->sc_ss)
43 #ifdef linux
44 /* fs and gs are not supported on *BSD. Hopefully we won't need them. */
45 #define FS_reg(context) ((context)->sc_fs)
46 #define GS_reg(context) ((context)->sc_gs)
47 #endif
49 #ifndef __FreeBSD__
50 #define EFL_reg(context) ((context)->sc_eflags)
51 #define FL_reg(context) (*(WORD*)(&(context)->sc_eflags))
52 #else
53 #define EFL_reg(context) ((context)->sc_efl)
54 #define FL_reg(context) (*(WORD*)(&(context)->sc_efl))
55 #endif
57 #define EIP_reg(context) ((context)->sc_eip)
58 #define ESP_reg(context) ((context)->sc_esp)
60 #define IP_reg(context) (*(WORD*)(&(context)->sc_eip))
61 #define SP_reg(context) (*(WORD*)(&(context)->sc_esp))
63 #define SET_CFLAG(context) (EFL_reg(context) |= 0x0001)
64 #define RESET_CFLAG(context) (EFL_reg(context) &= 0xfffffffe)
66 #endif /* __WINE_REGISTERS_H */