mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-12 03:01:32 +00:00
Log for assembler
Property for stack count Clt fixed Jump_End implemented
This commit is contained in:
parent
99d7f5f2c9
commit
f364366fac
4 changed files with 12 additions and 4 deletions
|
|
@ -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 };
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue