Removed IP_reg, SP_reg and FL_reg definitions to avoid potential
aliasing optimization problems.

diff --git a/debugger/registers.c b/debugger/registers.c
index 564d94e..bdd9906 100644
--- a/debugger/registers.c
+++ b/debugger/registers.c
@@ -31,22 +31,22 @@
         case REG_EFL: EFL_reg(&DEBUG_context) = val; break;
         case REG_EIP: EIP_reg(&DEBUG_context) = val; break;
         case REG_ESP: ESP_reg(&DEBUG_context) = val; break;
-        case REG_AX:  AX_reg(&DEBUG_context)  = val; break;
-        case REG_BX:  BX_reg(&DEBUG_context)  = val; break;
-        case REG_CX:  CX_reg(&DEBUG_context)  = val; break;
-        case REG_DX:  DX_reg(&DEBUG_context)  = val; break;
-        case REG_SI:  SI_reg(&DEBUG_context)  = val; break;
-        case REG_DI:  DI_reg(&DEBUG_context)  = val; break;
-        case REG_BP:  BP_reg(&DEBUG_context)  = val; break;
-        case REG_FL:  FL_reg(&DEBUG_context)  = val; break;
-        case REG_IP:  IP_reg(&DEBUG_context)  = val; break;
-        case REG_SP:  SP_reg(&DEBUG_context)  = val; break;
         case REG_CS:  CS_reg(&DEBUG_context)  = val; break;
         case REG_DS:  DS_reg(&DEBUG_context)  = val; break;
         case REG_ES:  ES_reg(&DEBUG_context)  = val; break;
         case REG_SS:  SS_reg(&DEBUG_context)  = val; break;
         case REG_FS:  FS_reg(&DEBUG_context)  = val; break;
         case REG_GS:  GS_reg(&DEBUG_context)  = val; break;
+        case REG_AX:  SET_LOWORD(EAX_reg(&DEBUG_context),val); break;
+        case REG_BX:  SET_LOWORD(EBX_reg(&DEBUG_context),val); break;
+        case REG_CX:  SET_LOWORD(ECX_reg(&DEBUG_context),val); break;
+        case REG_DX:  SET_LOWORD(EDX_reg(&DEBUG_context),val); break;
+        case REG_SI:  SET_LOWORD(ESI_reg(&DEBUG_context),val); break;
+        case REG_DI:  SET_LOWORD(EDI_reg(&DEBUG_context),val); break;
+        case REG_BP:  SET_LOWORD(EBP_reg(&DEBUG_context),val); break;
+        case REG_FL:  SET_LOWORD(EFL_reg(&DEBUG_context),val); break;
+        case REG_IP:  SET_LOWORD(EIP_reg(&DEBUG_context),val); break;
+        case REG_SP:  SET_LOWORD(ESP_reg(&DEBUG_context),val); break;
     }
 }
 
@@ -105,22 +105,22 @@
         case REG_EFL: return EFL_reg(&DEBUG_context);
         case REG_EIP: return EIP_reg(&DEBUG_context);
         case REG_ESP: return ESP_reg(&DEBUG_context);
-        case REG_AX:  return AX_reg(&DEBUG_context);
-        case REG_BX:  return BX_reg(&DEBUG_context);
-        case REG_CX:  return CX_reg(&DEBUG_context);
-        case REG_DX:  return DX_reg(&DEBUG_context);
-        case REG_SI:  return SI_reg(&DEBUG_context);
-        case REG_DI:  return DI_reg(&DEBUG_context);
-        case REG_BP:  return BP_reg(&DEBUG_context);
-        case REG_FL:  return FL_reg(&DEBUG_context);
-        case REG_IP:  return IP_reg(&DEBUG_context);
-        case REG_SP:  return SP_reg(&DEBUG_context);
         case REG_CS:  return CS_reg(&DEBUG_context);
         case REG_DS:  return DS_reg(&DEBUG_context);
         case REG_ES:  return ES_reg(&DEBUG_context);
         case REG_SS:  return SS_reg(&DEBUG_context);
         case REG_FS:  return FS_reg(&DEBUG_context);
         case REG_GS:  return GS_reg(&DEBUG_context);
+        case REG_AX:  return LOWORD(EAX_reg(&DEBUG_context));
+        case REG_BX:  return LOWORD(EBX_reg(&DEBUG_context));
+        case REG_CX:  return LOWORD(ECX_reg(&DEBUG_context));
+        case REG_DX:  return LOWORD(EDX_reg(&DEBUG_context));
+        case REG_SI:  return LOWORD(ESI_reg(&DEBUG_context));
+        case REG_DI:  return LOWORD(EDI_reg(&DEBUG_context));
+        case REG_BP:  return LOWORD(EBP_reg(&DEBUG_context));
+        case REG_FL:  return LOWORD(EFL_reg(&DEBUG_context));
+        case REG_IP:  return LOWORD(EIP_reg(&DEBUG_context));
+        case REG_SP:  return LOWORD(ESP_reg(&DEBUG_context));
     }
     return 0;  /* should not happen */
 }
@@ -199,9 +199,9 @@
     if (dbg_mode == 16)
     {
         fprintf( stderr,"\n IP:%04x SP:%04x BP:%04x FLAGS:%04x(%s)\n",
-                 IP_reg(&DEBUG_context), SP_reg(&DEBUG_context),
-                 BP_reg(&DEBUG_context), FL_reg(&DEBUG_context),
-		 DEBUG_Flags(FL_reg(&DEBUG_context), flag));
+                 LOWORD(EIP_reg(&DEBUG_context)), LOWORD(ESP_reg(&DEBUG_context)),
+                 LOWORD(EBP_reg(&DEBUG_context)), LOWORD(EFL_reg(&DEBUG_context)),
+		 DEBUG_Flags(LOWORD(EFL_reg(&DEBUG_context)), flag));
 	fprintf( stderr," AX:%04x BX:%04x CX:%04x DX:%04x SI:%04x DI:%04x\n",
                  AX_reg(&DEBUG_context), BX_reg(&DEBUG_context),
                  CX_reg(&DEBUG_context), DX_reg(&DEBUG_context),
diff --git a/debugger/stack.c b/debugger/stack.c
index dd64c5c..03924b0 100644
--- a/debugger/stack.c
+++ b/debugger/stack.c
@@ -211,7 +211,7 @@
         is16 = FALSE;
     } else {
         frames[0].cs = addr.seg = cs;
-        frames[0].eip = addr.off = IP_reg(&DEBUG_context);
+        frames[0].eip = addr.off = LOWORD(EIP_reg(&DEBUG_context));
         if (noisy)
           frames[0].frame = DEBUG_PrintAddress( &addr, 16, TRUE );
         else
diff --git a/dlls/winaspi/winaspi16.c b/dlls/winaspi/winaspi16.c
index 2249c52..0984397 100644
--- a/dlls/winaspi/winaspi16.c
+++ b/dlls/winaspi/winaspi16.c
@@ -520,9 +520,9 @@
 	ASPI_SendASPICommand(ptrSRB, ASPI_DOS);
 
 	/* simulate a normal RETF sequence as required by DPMI CallRMProcFar */
-	IP_reg(context) = *(stack++);
-	CS_reg(context) = *(stack++);
-	SP_reg(context) += 2*sizeof(WORD);
+	EIP_reg(context) = *(stack++);
+	CS_reg(context)  = *(stack++);
+	ESP_reg(context) += 2*sizeof(WORD);
 }
 
 
diff --git a/if1632/snoop.c b/if1632/snoop.c
index 127c4b2..ccc35f2 100644
--- a/if1632/snoop.c
+++ b/if1632/snoop.c
@@ -208,10 +208,10 @@
 	return (FARPROC16)(SEGPTR)MAKELONG(((char*)fun-(char*)dll->funs),dll->funhandle);
 }
 
-#define CALLER1REF (*(DWORD*)(PTR_SEG_OFF_TO_LIN(SS_reg(context),SP_reg(context)+4)))
+#define CALLER1REF (*(DWORD*)(PTR_SEG_OFF_TO_LIN(SS_reg(context),LOWORD(ESP_reg(context))+4)))
 void WINAPI SNOOP16_Entry(CONTEXT86 *context) {
 	DWORD		ordinal=0;
-	DWORD		entry=(DWORD)PTR_SEG_OFF_TO_LIN(CS_reg(context),IP_reg(context))-5;
+	DWORD		entry=(DWORD)PTR_SEG_OFF_TO_LIN(CS_reg(context),LOWORD(EIP_reg(context)))-5;
 	WORD		xcs = CS_reg(context);
 	SNOOP16_DLL	*dll = firstdll;
 	SNOOP16_FUN	*fun = NULL;
@@ -254,10 +254,10 @@
 	ret->dll	= dll;
 	ret->args	= NULL;
 	ret->ordinal	= ordinal;
-	ret->origSP	= SP_reg(context);
+	ret->origSP	= LOWORD(ESP_reg(context));
 
-	IP_reg(context)= LOWORD(fun->origfun);
-	CS_reg(context)= HIWORD(fun->origfun);
+	EIP_reg(context)= LOWORD(fun->origfun);
+	CS_reg(context) = HIWORD(fun->origfun);
 
 
 	DPRINTF("Call %s.%ld: %s(",dll->name,ordinal,fun->name);
@@ -265,19 +265,19 @@
 		max = fun->nrofargs;
 		if (max>16) max=16;
 		for (i=max;i--;)
-			DPRINTF("%04x%s",*(WORD*)((char *) PTR_SEG_OFF_TO_LIN(SS_reg(context),SP_reg(context))+8+sizeof(WORD)*i),i?",":"");
+			DPRINTF("%04x%s",*(WORD*)((char *) PTR_SEG_OFF_TO_LIN(SS_reg(context),LOWORD(ESP_reg(context)))+8+sizeof(WORD)*i),i?",":"");
 		if (max!=fun->nrofargs)
 			DPRINTF(" ...");
 	} else if (fun->nrofargs<0) {
 		DPRINTF("<unknown, check return>");
 		ret->args = HeapAlloc(SystemHeap,0,16*sizeof(WORD));
-		memcpy(ret->args,(LPBYTE)((char *) PTR_SEG_OFF_TO_LIN(SS_reg(context),SP_reg(context))+8),sizeof(WORD)*16);
+		memcpy(ret->args,(LPBYTE)((char *) PTR_SEG_OFF_TO_LIN(SS_reg(context),LOWORD(ESP_reg(context)))+8),sizeof(WORD)*16);
 	}
 	DPRINTF(") ret=%04x:%04x\n",HIWORD(ret->origreturn),LOWORD(ret->origreturn));
 }
 
 void WINAPI SNOOP16_Return(CONTEXT86 *context) {
-	SNOOP16_RETURNENTRY	*ret = (SNOOP16_RETURNENTRY*)((char *) PTR_SEG_OFF_TO_LIN(CS_reg(context),IP_reg(context))-5);
+	SNOOP16_RETURNENTRY	*ret = (SNOOP16_RETURNENTRY*)((char *) PTR_SEG_OFF_TO_LIN(CS_reg(context),LOWORD(EIP_reg(context)))-5);
 
 	/* We haven't found out the nrofargs yet. If we called a cdecl
 	 * function it is too late anyway and we can just set '0' (which 
@@ -285,10 +285,10 @@
 	 * If pascal -> everything ok.
 	 */
 	if (ret->dll->funs[ret->ordinal].nrofargs<0) {
-		ret->dll->funs[ret->ordinal].nrofargs=(SP_reg(context)-ret->origSP-4)/2;
+		ret->dll->funs[ret->ordinal].nrofargs=(LOWORD(ESP_reg(context))-ret->origSP-4)/2;
 	}
-	IP_reg(context) = LOWORD(ret->origreturn);
-	CS_reg(context) = HIWORD(ret->origreturn);
+	EIP_reg(context) = LOWORD(ret->origreturn);
+	CS_reg(context)  = HIWORD(ret->origreturn);
 	if (ret->args) {
 		int	i,max;
 
diff --git a/include/winnt.h b/include/winnt.h
index 8ca638e..b1f360e 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -580,11 +580,6 @@
 #define DL_reg(context)      (*(BYTE*)&EDX_reg(context))
 #define DH_reg(context)      (*((BYTE*)&EDX_reg(context)+1))
                             
-#define IP_reg(context)      (*(WORD*)&EIP_reg(context))
-#define SP_reg(context)      (*(WORD*)&ESP_reg(context))
-                            
-#define FL_reg(context)      (*(WORD*)&EFL_reg(context))
-
 #define SET_CFLAG(context)   (EFL_reg(context) |= 0x0001)
 #define RESET_CFLAG(context) (EFL_reg(context) &= ~0x0001)
 #define SET_ZFLAG(context)   (EFL_reg(context) |= 0x0040)
diff --git a/loader/ne/segment.c b/loader/ne/segment.c
index 10bb7ef..e9f30eb 100644
--- a/loader/ne/segment.c
+++ b/loader/ne/segment.c
@@ -660,8 +660,8 @@
 
 
     pModule->cs = 0;  /* Don't initialize it twice */
-    TRACE_(dll)("Calling LibMain, cs:ip=%04lx:%04x ds=%04lx di=%04x cx=%04x\n", 
-                 CS_reg(&context), IP_reg(&context), DS_reg(&context),
+    TRACE_(dll)("Calling LibMain, cs:ip=%04lx:%04lx ds=%04lx di=%04x cx=%04x\n", 
+                 CS_reg(&context), EIP_reg(&context), DS_reg(&context),
                  DI_reg(&context), CX_reg(&context) );
     Callbacks->CallRegisterShortProc( &context, 0 );
     return TRUE;
@@ -693,7 +693,7 @@
     ES_reg(&context) = ds;   /* who knows ... */
 
     CS_reg(&context) = HIWORD(entryPoint);
-    IP_reg(&context) = LOWORD(entryPoint);
+    EIP_reg(&context) = LOWORD(entryPoint);
     EBP_reg(&context) =  OFFSETOF( NtCurrentTeb()->cur_stack )
                          + (WORD)&((STACK16FRAME*)0)->bp;
 
@@ -704,8 +704,8 @@
     *(DWORD *)(stack - 14) = 0;             /* dwReserved1 */
     *(WORD *) (stack - 16) = 0;             /* wReserved2 */
 
-    TRACE_(dll)("Calling DllEntryPoint, cs:ip=%04lx:%04x\n",
-          CS_reg(&context), IP_reg(&context));
+    TRACE_(dll)("Calling DllEntryPoint, cs:ip=%04lx:%04lx\n",
+          CS_reg(&context), EIP_reg(&context));
 
     Callbacks->CallRegisterShortProc( &context, 16 );
 }
diff --git a/misc/error.c b/misc/error.c
index 2255e05..b1a706b 100644
--- a/misc/error.c
+++ b/misc/error.c
@@ -174,11 +174,11 @@
 		   to error handler (location at [bp-2]) */
 
 		WORD *stack = PTR_SEG_OFF_TO_LIN( SS_reg( context ), 
-						  BP_reg( context ));
-		SP_reg( context ) = BP_reg( context ) - 2;
-		BP_reg( context ) = stack[0] & 0xfffe;
+						  LOWORD(EBP_reg( context )) );
+		ESP_reg( context ) = LOWORD(EBP_reg( context )) - 2;
+		EBP_reg( context ) = stack[0] & 0xfffe;
 
-		IP_reg( context ) = stack[-1];
+		EIP_reg( context ) = stack[-1];
 
 		EAX_reg( context ) = ECX_reg( context ) = EDX_reg( context ) = 0;
 		ES_reg( context) = 0;
diff --git a/msdos/devices.c b/msdos/devices.c
index b6cd115..5d36328 100644
--- a/msdos/devices.c
+++ b/msdos/devices.c
@@ -132,9 +132,9 @@
 {
   WORD *stack = CTX_SEG_OFF_TO_LIN(ctx, SS_reg(ctx), ESP_reg(ctx));
 
-  IP_reg(ctx) = *(stack++);
-  CS_reg(ctx) = *(stack++);
-  SP_reg(ctx) += 2*sizeof(WORD);
+  EIP_reg(ctx) = *(stack++);
+  CS_reg(ctx)  = *(stack++);
+  ESP_reg(ctx) += 2*sizeof(WORD);
 }
 
 static void do_strategy(CONTEXT86*ctx, int id, int extra)
@@ -522,17 +522,17 @@
   memset(&ctx, 0, sizeof(ctx));
 
   /* ES:BX points to request for strategy routine */
-  ES_reg(&ctx) = HIWORD(DOS_LOLSeg);
-  BX_reg(&ctx) = ALLDEV_OFS;
+  ES_reg(&ctx)  = HIWORD(DOS_LOLSeg);
+  EBX_reg(&ctx) = ALLDEV_OFS;
 
   /* call strategy routine */
   CS_reg(&ctx) = SELECTOROF(dev);
-  IP_reg(&ctx) = dhdr->strategy;
+  EIP_reg(&ctx) = dhdr->strategy;
   DPMI_CallRMProc(&ctx, 0, 0, 0);
 
   /* call interrupt routine */
   CS_reg(&ctx) = SELECTOROF(dev);
-  IP_reg(&ctx) = dhdr->interrupt;
+  EIP_reg(&ctx) = dhdr->interrupt;
   DPMI_CallRMProc(&ctx, 0, 0, 0);
 
   /* completed, copy request back */
diff --git a/msdos/dpmi.c b/msdos/dpmi.c
index 58574cc..9deb642 100644
--- a/msdos/dpmi.c
+++ b/msdos/dpmi.c
@@ -173,9 +173,9 @@
     call->esi = ESI_reg(context);
     call->edi = EDI_reg(context);
     call->ebp = EBP_reg(context);
-    call->fl  = FL_reg(context);
-    call->ip  = IP_reg(context);
-    call->sp  = SP_reg(context);
+    call->fl  = LOWORD(EFL_reg(context));
+    call->ip  = LOWORD(EIP_reg(context));
+    call->sp  = LOWORD(ESP_reg(context));
     call->cs  = CS_reg(context);
     call->ds  = DS_reg(context);
     call->es  = ES_reg(context);
@@ -277,7 +277,7 @@
                  EAX_reg(context), EBX_reg(context), ECX_reg(context), EDX_reg(context) );
     TRACE("ESI=%08lx EDI=%08lx ES=%04lx DS=%04lx CS:IP=%04lx:%04x, %d WORD arguments, %s\n",
                  ESI_reg(context), EDI_reg(context), ES_reg(context), DS_reg(context),
-                 CS_reg(context), IP_reg(context), args, iret?"IRET":"FAR" );
+                 CS_reg(context), LOWORD(EIP_reg(context)), args, iret?"IRET":"FAR" );
 
 callrmproc_again:
 
@@ -286,23 +286,23 @@
     code = CTX_SEG_OFF_TO_LIN(context, CS_reg(context), EIP_reg(context));
     switch (*code) {
     case 0xe9: /* JMP NEAR */
-      IP_reg(context) += 3 + *(WORD *)(code+1);
+      EIP_reg(context) += 3 + *(WORD *)(code+1);
       /* yeah, I know these gotos don't look good... */
       goto callrmproc_again;
     case 0xea: /* JMP FAR */
-      IP_reg(context) = *(WORD *)(code+1);
+      EIP_reg(context) = *(WORD *)(code+1);
       CS_reg(context) = *(WORD *)(code+3);
       /* ...but since the label is there anyway... */
       goto callrmproc_again;
     case 0xeb: /* JMP SHORT */
-      IP_reg(context) += 2 + *(signed char *)(code+1);
+      EIP_reg(context) += 2 + *(signed char *)(code+1);
       /* ...because of other gotos below, so... */
       goto callrmproc_again;
     }
 
 /* shortcut for chaining to internal interrupt handlers */
     if ((CS_reg(context) == 0xF000) && iret) {
-        return INT_RealModeInterrupt( IP_reg(context)/4, context);
+        return INT_RealModeInterrupt( LOWORD(EIP_reg(context))/4, context);
     }
 
 /* shortcut for RMCBs */
@@ -324,7 +324,7 @@
         if (!SS_reg(context)) {
             alloc = 1; /* allocate default stack */
             stack16 = addr = DOSMEM_GetBlock( pModule->self, 64, (UINT16 *)&(SS_reg(context)) );
-            SP_reg(context) = 64-2;
+            ESP_reg(context) = 64-2;
             stack16 += 32-1;
             if (!addr) {
                 ERR("could not allocate default stack\n");
@@ -333,7 +333,7 @@
         } else {
             stack16 = CTX_SEG_OFF_TO_LIN(context, SS_reg(context), ESP_reg(context));
         }
-        SP_reg(context) -= (args + (iret?1:0)) * sizeof(WORD);
+        ESP_reg(context) -= (args + (iret?1:0)) * sizeof(WORD);
 #else
     if (!already) {
         stack16 = (LPWORD) CURRENT_STACK16;
@@ -343,14 +343,14 @@
         /* push flags if iret */
         if (iret) {
             stack16--; args++;
-            *stack16 = FL_reg(context);
+            *stack16 = LOWORD(EFL_reg(context));
         }
 #ifdef MZ_SUPPORTED
         /* push return address (return to interrupt wrapper) */
         *(--stack16) = DPMI_wrap_seg;
         *(--stack16) = 0;
         /* adjust stack */
-        SP_reg(context) -= 2*sizeof(WORD);
+        ESP_reg(context) -= 2*sizeof(WORD);
 #endif
         already = 1;
     }
@@ -360,7 +360,7 @@
         DPMI_CallRMCBProc(context, CurrRMCB, pModule->lpDosTask?pModule->lpDosTask->dpmi_flag:0);
         /* check if we returned to where we thought we would */
         if ((CS_reg(context) != DPMI_wrap_seg) ||
-            (IP_reg(context) != 0)) {
+            (LOWORD(EIP_reg(context)) != 0)) {
             /* we need to continue at different address in real-mode space,
                so we need to set it all up for real mode again */
             goto callrmproc_again;
@@ -370,12 +370,12 @@
 #if 0 /* this was probably unnecessary */
         /* push call address */
         *(--stack16) = CS_reg(context);
-        *(--stack16) = IP_reg(context);
+        *(--stack16) = LOWORD(EIP_reg(context));
         /* adjust stack */
-        SP_reg(context) -= 2*sizeof(WORD);
+        ESP_reg(context) -= 2*sizeof(WORD);
         /* set initial CS:IP to the wrapper's "lret" */
         CS_reg(context) = DPMI_wrap_seg;
-        IP_reg(context) = 2;
+        EIP_reg(context) = 2;
 #endif
         TRACE("entering real mode...\n");
         DOSVM_Enter( context );
@@ -386,7 +386,7 @@
         seg_addr = PTR_SEG_OFF_TO_SEGPTR( sel, 0 );
 
         CS_reg(context) = HIWORD(seg_addr);
-        IP_reg(context) = LOWORD(seg_addr);
+        EIP_reg(context) = LOWORD(seg_addr);
         EBP_reg(context) = OFFSETOF( NtCurrentTeb()->cur_stack )
                                    + (WORD)&((STACK16FRAME*)0)->bp;
         Callbacks->CallRegisterShortProc(context, args*sizeof(WORD));
@@ -452,7 +452,7 @@
 	return;
     }
     INT_GetRealModeContext(p, &context16);
-    DPMI_CallRMProc( &context16, ((LPWORD)PTR_SEG_OFF_TO_LIN(SS_reg(context), SP_reg(context)))+3,
+    DPMI_CallRMProc( &context16, ((LPWORD)PTR_SEG_OFF_TO_LIN(SS_reg(context), LOWORD(ESP_reg(context))))+3,
                      CX_reg(context), iret );
     INT_SetRealModeContext(p, &context16);
 }
@@ -519,12 +519,12 @@
 	NewRMCB->proc_sel = DS_reg(context);
 	NewRMCB->regs_ofs = DI_reg(context);
 	NewRMCB->regs_sel = ES_reg(context);
-	CX_reg(context) = HIWORD(NewRMCB->address);
-	DX_reg(context) = LOWORD(NewRMCB->address);
+	SET_LOWORD( ECX_reg(context), HIWORD(NewRMCB->address) );
+	SET_LOWORD( EDX_reg(context), LOWORD(NewRMCB->address) );
     }
     else
     {
-	AX_reg(context) = 0x8015; /* callback unavailable */
+	SET_LOWORD( EAX_reg(context), 0x8015 ); /* callback unavailable */
 	SET_CFLAG(context);
     }
 }
@@ -575,7 +575,7 @@
           CX_reg(context), DX_reg(context));
 
     if (DPMI_FreeRMCB(MAKELONG(DX_reg(context), CX_reg(context)))) {
-	AX_reg(context) = 0x8024; /* invalid callback address */
+	SET_LOWORD( EAX_reg(context), 0x8024 ); /* invalid callback address */
 	SET_CFLAG(context);
     }
 }
@@ -621,8 +621,8 @@
     pm_ctx = *context;
     CS_reg(&pm_ctx) = lpDosTask->dpmi_sel;
 /* our mode switch wrapper expects the new CS in DX, and the new SS in AX */
-    AX_reg(&pm_ctx) = ss;
-    DX_reg(&pm_ctx) = cs;
+    EAX_reg(&pm_ctx) = ss;
+    EDX_reg(&pm_ctx) = cs;
     DS_reg(&pm_ctx) = ds;
     ES_reg(&pm_ctx) = es;
     FS_reg(&pm_ctx) = 0;
@@ -775,10 +775,10 @@
     {
     case 0x0000:  /* Allocate LDT descriptors */
     	TRACE("allocate LDT descriptors (%d)\n",CX_reg(context));
-        if (!(AX_reg(context) = AllocSelectorArray16( CX_reg(context) )))
+        if (!(EAX_reg(context) = AllocSelectorArray16( CX_reg(context) )))
         {
     	    TRACE("failed\n");
-            AX_reg(context) = 0x8011;  /* descriptor unavailable */
+            EAX_reg(context) = 0x8011;  /* descriptor unavailable */
             SET_CFLAG(context);
         }
 	TRACE("success, array starts at 0x%04x\n",AX_reg(context));
@@ -788,7 +788,7 @@
     	TRACE("free LDT descriptor (0x%04x)\n",BX_reg(context));
         if (FreeSelector16( BX_reg(context) ))
         {
-            AX_reg(context) = 0x8022;  /* invalid selector */
+            EAX_reg(context) = 0x8022;  /* invalid selector */
             SET_CFLAG(context);
         }
         else
@@ -818,36 +818,35 @@
             case 0xe000: entryPoint = 190; break;  /* __E000H */
             case 0xf000: entryPoint = 194; break;  /* __F000H */
             default:
-	    	AX_reg(context) = DOSMEM_AllocSelector(BX_reg(context));
+	    	EAX_reg(context) = DOSMEM_AllocSelector(BX_reg(context));
                 break;
             }
             if (entryPoint) 
-                AX_reg(context) = LOWORD(NE_GetEntryPoint( 
-                                                 GetModuleHandle16( "KERNEL" ),
-                                                 entryPoint ));
+                EAX_reg(context) = LOWORD(NE_GetEntryPoint( GetModuleHandle16( "KERNEL" ),
+                                                            entryPoint ));
         }
         break;
 
     case 0x0003:  /* Get next selector increment */
     	TRACE("get selector increment (__AHINCR)\n");
-        AX_reg(context) = __AHINCR;
+        EAX_reg(context) = __AHINCR;
         break;
 
     case 0x0004:  /* Lock selector (not supported) */
     	FIXME("lock selector not supported\n");
-        AX_reg(context) = 0;  /* FIXME: is this a correct return value? */
+        EAX_reg(context) = 0;  /* FIXME: is this a correct return value? */
         break;
 
     case 0x0005:  /* Unlock selector (not supported) */
     	FIXME("unlock selector not supported\n");
-        AX_reg(context) = 0;  /* FIXME: is this a correct return value? */
+        EAX_reg(context) = 0;  /* FIXME: is this a correct return value? */
         break;
 
     case 0x0006:  /* Get selector base address */
     	TRACE("get selector base address (0x%04x)\n",BX_reg(context));
         if (!(dw = GetSelectorBase( BX_reg(context) )))
         {
-            AX_reg(context) = 0x8022;  /* invalid selector */
+            EAX_reg(context) = 0x8022;  /* invalid selector */
             SET_CFLAG(context);
         }
         else
diff --git a/msdos/int21.c b/msdos/int21.c
index a155922..0ab30e9 100644
--- a/msdos/int21.c
+++ b/msdos/int21.c
@@ -1130,7 +1130,7 @@
             if (scan) {
                 /* return pending scancode */
                 AL_reg(context) = scan;
-                FL_reg(context) &= ~0x40; /* clear ZF */
+                EFL_reg(context) &= ~0x40; /* clear ZF */
                 scan = 0;
             } else {
                 char ascii;
@@ -1138,13 +1138,13 @@
                     CONSOLE_GetKeystroke(&scan,&ascii);
                     /* return ASCII code */
                     AL_reg(context) = ascii;
-                    FL_reg(context) &= ~0x40; /* clear ZF */
+                    EFL_reg(context) &= ~0x40; /* clear ZF */
                     /* return scan code on next call only if ascii==0 */
                     if (ascii) scan = 0;
                 } else {
                     /* nothing pending, clear everything */
                     AL_reg(context) = 0;
-                    FL_reg(context) |= 0x40; /* set ZF */
+                    EFL_reg(context) |= 0x40; /* set ZF */
                     scan = 0; /* just in case */
                 }
             }
diff --git a/msdos/int33.c b/msdos/int33.c
index 1f5f229..e78f78b 100644
--- a/msdos/int33.c
+++ b/msdos/int33.c
@@ -59,14 +59,14 @@
   MCALLDATA *data = (MCALLDATA *)mdata;
   CONTEXT86 ctx = *context;
 
-  AX_reg(&ctx) = data->mask;
-  BX_reg(&ctx) = data->but;
-  CX_reg(&ctx) = data->x;
-  DX_reg(&ctx) = data->y;
-  SI_reg(&ctx) = data->mx;
-  DI_reg(&ctx) = data->my;
-  CS_reg(&ctx) = SELECTOROF(data->proc);
-  IP_reg(&ctx) = OFFSETOF(data->proc);
+  EAX_reg(&ctx) = data->mask;
+  EBX_reg(&ctx) = data->but;
+  ECX_reg(&ctx) = data->x;
+  EDX_reg(&ctx) = data->y;
+  ESI_reg(&ctx) = data->mx;
+  EDI_reg(&ctx) = data->my;
+  CS_reg(&ctx)  = SELECTOROF(data->proc);
+  EIP_reg(&ctx) = OFFSETOF(data->proc);
   free(data);
   DPMI_CallRMProc(&ctx, NULL, 0, 0);
 }