From 00e6d3c31d1a221d027db8465d5db0ed21a04876 Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Thu, 1 Jan 2004 20:33:22 +0000 Subject: [PATCH] No longer directly stack variables in assembly Changed initial flag loading Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1519 --- src/cpu/core_dyn_x86/risc_x86.h | 34 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/src/cpu/core_dyn_x86/risc_x86.h b/src/cpu/core_dyn_x86/risc_x86.h index 6f482fcb..b04866ae 100644 --- a/src/cpu/core_dyn_x86/risc_x86.h +++ b/src/cpu/core_dyn_x86/risc_x86.h @@ -71,7 +71,6 @@ public: }; -static Bit32u kut=10; static BlockReturn gen_runcode(Bit8u * code) { BlockReturn retval; #if defined (_MSC_VER) @@ -106,35 +105,26 @@ static BlockReturn gen_runcode(Bit8u * code) { } #else __asm__ volatile ( - "pushfl \n" - "movl %1,%%ebx \n" - "andl %2,%%ebx \n" - "popl %%ecx \n" - "andl %3,%%ecx \n" - "orl %%ebx,%%ecx \n" - "pushl %%ecx \n" + "movl %1,%%esi \n" + "andl %2,%%esi \n" + "pushl %%ebp \n" + "pushl %%esi \n" "popfl \n" - "call %4 \n" + "calll %4 \n" + "popl %%ebp \n" "pushfl \n" - "movl %1,%%ebx \n" - "andl %3,%%ebx \n" - "popl %%ecx \n" - "andl %2,%%ecx \n" - "orl %%ecx,%%ebx \n" - "movl %%ebx,%1 \n" + "andl %3,(%1) \n" + "popl %%esi \n" + "andl %2,%%esi \n" + "orl %%esi,(%1) \n" :"=a" (retval) - :"m" (reg_flags), "n" (FMASK_TEST),"n" (~FMASK_TEST),"m" (code) - :"%ecx","%edx","%ebx","%ebp","%edi","%esi","cc","memory" + :"m" (reg_flags), "n" (FMASK_TEST),"n" (~FMASK_TEST),"r" (code) + :"%ecx","%edx","%ebx","%edi","%esi","cc","memory" ); #endif return retval; } - - - - - static GenReg * FindDynReg(DynReg * dynreg) { x86gen.last_used++; if (dynreg->genreg) {