Log for assembler

Property for stack count
Clt fixed
Jump_End implemented
This commit is contained in:
gero_cp 2009-09-05 17:53:43 +00:00
parent 99d7f5f2c9
commit f364366fac
4 changed files with 12 additions and 4 deletions

View file

@ -68,7 +68,7 @@ namespace Cosmos.IL2CPU.X86.IL
//new CPUx86.Jump { DestinationLabel = NextInstructionLabel };
Jump_End( aMethod );
new CPU.Label( LabelFalse );
new CPUx86.Add { DestinationReg = CPUx86.Registers.ESP, SourceValue = 4 };
new CPUx86.Push { DestinationValue = 0 };

View file

@ -23,8 +23,10 @@ namespace Cosmos.IL2CPU.X86
new CPU.Jump { DestinationLabel = MethodInfoLabelGenerator.GenerateLabelName(aMethod.MethodBase) + "___EXCEPTION___EXIT" };
}
protected void Jump_End(MethodInfo aMethod) {
throw new NotImplementedException();
protected void Jump_End(MethodInfo aMethod)
{
#warning todo: Jump_End jumps to ___EXCEPTION___EXIT
new CPU.Jump { DestinationLabel = MethodInfoLabelGenerator.GenerateLabelName( aMethod.MethodBase ) + "___EXCEPTION___EXIT" };
}
protected uint GetStackCountForLocal(MethodInfo aMethod, LocalVariableInfo aField)

View file

@ -17,7 +17,7 @@ namespace Cosmos.IL2CPU {
private static SortedList<int, Stack<Assembler>> mCurrentInstance = new SortedList<int, Stack<Assembler>>();
protected internal List<Instruction> mInstructions = new List<Instruction>();
private List<DataMember> mDataMembers = new List<DataMember>();
private System.IO.TextWriter mLog;
#region Properties
public static Stack<Assembler> CurrentInstance
@ -56,6 +56,7 @@ namespace Cosmos.IL2CPU {
public Assembler()
{
mLog = new System.IO.StreamWriter( "Cosmos.Assembler.Log" );
InitILOps();
CurrentInstance.Push( this );
}
@ -149,7 +150,10 @@ namespace Cosmos.IL2CPU {
} else {
xILOp = mILOpsHi[xOpCodeVal & 0xFF];
}
mLog.Write ( "[" + xOpCode.ToString() + "] \t Stack start: " + Stack.Count.ToString() );
xILOp.Execute(aMethod, xOpCode);
mLog.WriteLine( " end: " + Stack.Count.ToString() );
mLog.Flush();
}
}

View file

@ -56,6 +56,8 @@ namespace Cosmos.IL2CPU {
private Stack<Item> mStack = new Stack<Item>();
public int Count {get { return mStack.Count; } }
public Item Peek() {
return mStack.Peek();
}