Christian Costa : krnl386.exe: If we use operands order of AT&T asm syntax, we' d better use % for registers as in winedbg and GNU assembler to avoid confusion .
Alexandre Julliard
julliard at winehq.org
Tue Oct 23 13:37:18 CDT 2012
Module: wine
Branch: master
Commit: 2a43bb22618ac4d2a29487414a55cfaac9a6b5a1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2a43bb22618ac4d2a29487414a55cfaac9a6b5a1
Author: Christian Costa <titan.costa at gmail.com>
Date: Mon Oct 22 21:29:21 2012 +0200
krnl386.exe: If we use operands order of AT&T asm syntax, we'd better use % for registers as in winedbg and GNU assembler to avoid confusion.
---
dlls/krnl386.exe16/instr.c | 78 ++++++++++++++++++++++----------------------
1 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/dlls/krnl386.exe16/instr.c b/dlls/krnl386.exe16/instr.c
index 5db0b2b..59420ef 100644
--- a/dlls/krnl386.exe16/instr.c
+++ b/dlls/krnl386.exe16/instr.c
@@ -512,57 +512,57 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
case 0x0f: /* extended instruction */
switch(instr[1])
{
- case 0x22: /* mov eax, crX */
+ case 0x22: /* mov %eax, %crX */
switch (instr[2])
{
- case 0xc0:
- ERR("mov eax,cr0 at 0x%08x, EAX=0x%08x\n",
- context->Eip,context->Eax );
+ case 0xc0:
+ ERR("mov %%eax, %%cr0 at 0x%08x, EAX=0x%08x\n",
+ context->Eip,context->Eax );
context->Eip += prefixlen+3;
- return ExceptionContinueExecution;
- default:
- break; /*fallthrough to bad instruction handling */
- }
- break; /*fallthrough to bad instruction handling */
- case 0x20: /* mov crX, eax */
+ return ExceptionContinueExecution;
+ default:
+ break; /* Fallthrough to bad instruction handling */
+ }
+ break; /* Fallthrough to bad instruction handling */
+ case 0x20: /* mov %crX, %eax */
switch (instr[2])
{
- case 0xe0: /* mov cr4, eax */
- /* CR4 register . See linux/arch/i386/mm/init.c, X86_CR4_ defs
- * bit 0: VME Virtual Mode Exception ?
- * bit 1: PVI Protected mode Virtual Interrupt
- * bit 2: TSD Timestamp disable
- * bit 3: DE Debugging extensions
- * bit 4: PSE Page size extensions
- * bit 5: PAE Physical address extension
- * bit 6: MCE Machine check enable
- * bit 7: PGE Enable global pages
- * bit 8: PCE Enable performance counters at IPL3
- */
- ERR("mov cr4,eax at 0x%08x\n",context->Eip);
+ case 0xe0: /* mov %cr4, %eax */
+ /* CR4 register: See linux/arch/i386/mm/init.c, X86_CR4_ defs
+ * bit 0: VME Virtual Mode Exception ?
+ * bit 1: PVI Protected mode Virtual Interrupt
+ * bit 2: TSD Timestamp disable
+ * bit 3: DE Debugging extensions
+ * bit 4: PSE Page size extensions
+ * bit 5: PAE Physical address extension
+ * bit 6: MCE Machine check enable
+ * bit 7: PGE Enable global pages
+ * bit 8: PCE Enable performance counters at IPL3
+ */
+ ERR("mov %%cr4, %%eax at 0x%08x\n",context->Eip);
context->Eax = 0;
context->Eip += prefixlen+3;
- return ExceptionContinueExecution;
- case 0xc0: /* mov cr0, eax */
- ERR("mov cr0,eax at 0x%08x\n",context->Eip);
+ return ExceptionContinueExecution;
+ case 0xc0: /* mov %cr0, %eax */
+ ERR("mov %%cr0, %%eax at 0x%08x\n",context->Eip);
context->Eax = 0x10; /* FIXME: set more bits ? */
context->Eip += prefixlen+3;
- return ExceptionContinueExecution;
- default: /* fallthrough to illegal instruction */
- break;
- }
- /* fallthrough to illegal instruction */
- break;
- case 0x21: /* mov drX, eax */
+ return ExceptionContinueExecution;
+ default: /* Fallthrough to illegal instruction */
+ break;
+ }
+ /* Fallthrough to illegal instruction */
+ break;
+ case 0x21: /* mov %drX, %eax */
switch (instr[2])
{
- case 0xc8: /* mov dr1, eax */
- TRACE("mov dr1,eax at 0x%08x\n",context->Eip);
+ case 0xc8: /* mov %dr1, %eax */
+ TRACE("mov %%dr1, %%eax at 0x%08x\n",context->Eip);
context->Eax = context->Dr1;
context->Eip += prefixlen+3;
return ExceptionContinueExecution;
- case 0xf8: /* mov dr7, eax */
- TRACE("mov dr7,eax at 0x%08x\n",context->Eip);
+ case 0xf8: /* mov %dr7, %eax */
+ TRACE("mov %%dr7, %%eax at 0x%08x\n",context->Eip);
context->Eax = 0x400;
context->Eip += prefixlen+3;
return ExceptionContinueExecution;
@@ -570,10 +570,10 @@ DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
ERR("Unsupported DR register, eip+2 is %02x\n", instr[2]);
/* fallthrough to illegal instruction */
break;
- case 0x23: /* mov eax drX */
+ case 0x23: /* mov %eax, %drX */
switch (instr[2])
{
- case 0xc8: /* mov eax, dr1 */
+ case 0xc8: /* mov %eax, %dr1 */
context->Dr1 = context->Eax;
context->Eip += prefixlen+3;
return ExceptionContinueExecution;
More information about the wine-cvs
mailing list