From fa5343345e027d4be197c9a394734d958ac8aab9 Mon Sep 17 00:00:00 2001 From: kudzu_cp <6d05c8c8ef5431987001abfdb2eadc9593ac9498> Date: Sun, 30 Aug 2009 19:40:15 +0000 Subject: [PATCH] --- source2/IL2PCU/Cosmos.IL2CPU/Assembler.cs | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/source2/IL2PCU/Cosmos.IL2CPU/Assembler.cs b/source2/IL2PCU/Cosmos.IL2CPU/Assembler.cs index c3c8e9771..127de1e1c 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU/Assembler.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU/Assembler.cs @@ -78,9 +78,7 @@ namespace Cosmos.IL2CPU //} } - #region Methods - - public BaseAssemblerElement GetAssemblerElement( int aIndex ) + public BaseAssemblerElement GetAssemblerElement( int aIndex ) { if( aIndex >= mInstructions.Count ) { @@ -133,25 +131,20 @@ namespace Cosmos.IL2CPU xOpCodeVal = ( uint )xOpCode.OpCode; if (xOpCodeVal <= 0xFF) { xILOp = mILOpsLo[xOpCodeVal]; - } - else - { + } else { xILOp = mILOpsHi[xOpCodeVal & 0xFF]; } + xILOp.Execute(aMethod, xOpCode); } } protected abstract void InitILOps(); - protected void InitILOps( Type aAssemblerBaseOp ) - { - foreach( var xType in aAssemblerBaseOp.Assembly.GetExportedTypes() ) - { - if( xType.IsSubclassOf( aAssemblerBaseOp ) ) - { + protected void InitILOps( Type aAssemblerBaseOp ) { + foreach( var xType in aAssemblerBaseOp.Assembly.GetExportedTypes() ) { + if( xType.IsSubclassOf( aAssemblerBaseOp ) ) { var xAttribs = ( OpCodeAttribute[] )xType.GetCustomAttributes( typeof( OpCodeAttribute ), false ); - foreach( var xAttrib in xAttribs ) - { + foreach( var xAttrib in xAttribs ) { var xOpCode = ( ushort )xAttrib.OpCode; var xCtor = xType.GetConstructor( new Type[] { typeof( Assembler ) } ); var xILOp = ( ILOp )xCtor.Invoke( new Object[] { this } ); @@ -164,6 +157,6 @@ namespace Cosmos.IL2CPU } } } - #endregion + } } \ No newline at end of file