This commit is contained in:
Matthijs ter Woord 2016-06-15 12:16:27 -04:00
parent f6f0bab95b
commit 1dc41f1a4b
10 changed files with 20 additions and 44 deletions

View file

@ -169,10 +169,7 @@ namespace Cosmos.Hardware
SourceValue = 1
};
new Jump
{
DestinationLabel = "mouse_read_exit"
};
XS.Jump("mouse_read_exit");
}
XS.Label("mouse_read_ready");
@ -289,10 +286,7 @@ namespace Cosmos.Hardware
SourceValue = 1
};
new Jump
{
DestinationLabel = "mouse_write_exit"
};
XS.Jump("mouse_write_exit");
}
XS.Label("mouse_write_ok1");
@ -343,10 +337,7 @@ namespace Cosmos.Hardware
SourceValue = 1
};
new Jump
{
DestinationLabel = "mouse_write_exit"
};
XS.Jump("mouse_write_exit");
}
XS.Label("mouse_write_ok");
@ -403,10 +394,7 @@ namespace Cosmos.Hardware
SourceValue = 1
};
new Jump
{
DestinationLabel = "mouse_write_exit"
};
XS.Jump("mouse_write_exit");
}
XS.Label("mouse_write_ok3");
@ -523,10 +511,7 @@ namespace Cosmos.Hardware
{
DestinationLabel = "mouse_cmd_wait"
};
new Jump
{
DestinationLabel = "mouse_cmd_error"
};
XS.Jump("mouse_cmd_error");
}
XS.Label("mouse_cmd_send");
@ -585,10 +570,7 @@ namespace Cosmos.Hardware
DestinationReg = RegistersEnum.AH,
SourceValue = 0x01
};
new Jump
{
DestinationLabel = "mouse_cmd_exit"
};
XS.Jump("mouse_cmd_exit");
}
XS.Label("mouse_cmd_ok");

View file

@ -187,7 +187,7 @@ namespace Cosmos.IL2CPU
XS.Compare(xName, 1, destinationIsIndirect: true, size: RegisterSize.Byte8);
new ConditionalJump { Condition = ConditionalTestEnum.Equal, DestinationLabel = ".BeforeQuickReturn" };
XS.Set(xName, 1, destinationIsIndirect: true, size: RegisterSize.Byte8);
new Jump { DestinationLabel = ".AfterCCTorAlreadyCalledCheck" };
XS.Jump(".AfterCCTorAlreadyCalledCheck");
XS.Label(".BeforeQuickReturn");
XS.Set(OldToNewRegister(RegistersEnum.ECX), 0);
XS.Return();
@ -838,10 +838,7 @@ namespace Cosmos.IL2CPU
protected void Jump(string aLabelName)
{
new Jump
{
DestinationLabel = aLabelName
};
XS.Jump(aLabelName);
}
protected FieldInfo ResolveField(MethodInfo method, string fieldId, bool aOnlyInstance)

View file

@ -361,10 +361,7 @@ namespace Cosmos.IL2CPU
XS.Label(".loop");
new ClearInterruptFlag();
new Halt();
new Jump
{
DestinationLabel = ".loop"
};
XS.Jump(".loop");
if (mComPort > 0)
{

View file

@ -47,15 +47,15 @@ namespace Cosmos.IL2CPU.X86.IL {
XS.Pop(XSRegisters.OldToNewRegister(RegistersEnum.EAX));
new Compare { DestinationReg = RegistersEnum.EAX, SourceReg = RegistersEnum.ESP, SourceIsIndirect = true };
new ConditionalJump { Condition = ConditionalTestEnum.Equal, DestinationLabel = Label.LastFullLabel + ".True" };
new Jump { DestinationLabel = Label.LastFullLabel + ".False" };
XS.Jump(Label.LastFullLabel + ".False");
XS.Label(".True");
XS.Add(XSRegisters.OldToNewRegister(RegistersEnum.ESP), 4);
new Push { DestinationValue = 1 };
new Jump { DestinationLabel = xNextLabel };
XS.Jump(xNextLabel);
XS.Label(".False");
XS.Add(XSRegisters.OldToNewRegister(RegistersEnum.ESP), 4);
new Push { DestinationValue = 0 };
new Jump { DestinationLabel = xNextLabel };
XS.Jump(xNextLabel);
}
}
else if (xSize > 4)
@ -93,7 +93,7 @@ namespace Cosmos.IL2CPU.X86.IL {
XS.Add(XSRegisters.OldToNewRegister(RegistersEnum.ESP), 8);
XS.Add(XSRegisters.OldToNewRegister(RegistersEnum.EAX), 1);
XS.Push(XSRegisters.OldToNewRegister(RegistersEnum.EAX));
new Jump { DestinationLabel = xNextLabel };
XS.Jump(xNextLabel);
XS.Label(Label.LastFullLabel + ".False");
//eax = 0
XS.Add(XSRegisters.OldToNewRegister(RegistersEnum.ESP), 8);

View file

@ -93,11 +93,11 @@ namespace Cosmos.IL2CPU.X86.IL
XS.Pop(XSRegisters.OldToNewRegister(RegistersEnum.EAX));
new Compare { DestinationReg = RegistersEnum.EAX, SourceReg = RegistersEnum.ESP, SourceIsIndirect = true };
new ConditionalJump { Condition = ConditionalTestEnum.LessThan, DestinationLabel = LabelTrue };
new Jump { DestinationLabel = LabelFalse };
XS.Jump(LabelFalse);
XS.Label(LabelTrue );
XS.Add(XSRegisters.OldToNewRegister(RegistersEnum.ESP), 4);
new Push { DestinationValue = 1 };
new Jump { DestinationLabel = xNextLabel };
XS.Jump(xNextLabel);
XS.Label(LabelFalse );
XS.Add(XSRegisters.OldToNewRegister(RegistersEnum.ESP), 4);
new CPUx86.Push { DestinationValue = 0 };

View file

@ -96,7 +96,7 @@ namespace Cosmos.IL2CPU.X86.IL
new Compare { DestinationReg = RegistersEnum.EAX, SourceReg = RegistersEnum.ESP, SourceIsIndirect = true };
new ConditionalJump { Condition = ConditionalTestEnum.Below, DestinationLabel = LabelTrue };
new Jump { DestinationLabel = LabelFalse };
XS.Jump(LabelFalse);
XS.Label(LabelTrue );
XS.Add(XSRegisters.OldToNewRegister(RegistersEnum.ESP), 4);
new Push { DestinationValue = 1 };

View file

@ -90,7 +90,7 @@ namespace Cosmos.IL2CPU.X86.IL
XS.Push(XSRegisters.OldToNewRegister(RegistersEnum.ECX));
new Compare { DestinationReg = RegistersEnum.EAX, SourceReg = RegistersEnum.ESP, SourceIsIndirect = true };
new ConditionalJump { Condition = ConditionalTestEnum.LessThan, DestinationLabel = LabelTrue };
new Jump { DestinationLabel = LabelFalse };
XS.Jump(LabelFalse);
XS.Label(LabelTrue );
XS.Add(XSRegisters.OldToNewRegister(RegistersEnum.ESP), 4);
new Push { DestinationValue = 1 };

View file

@ -84,7 +84,7 @@ namespace Cosmos.IL2CPU.X86.IL
XS.Push(XSRegisters.OldToNewRegister(RegistersEnum.ECX));
new Compare { DestinationReg = RegistersEnum.EAX, SourceReg = RegistersEnum.ESP, SourceIsIndirect = true };
new ConditionalJump { Condition = ConditionalTestEnum.Below, DestinationLabel = LabelTrue };
new Jump { DestinationLabel = LabelFalse };
XS.Jump(LabelFalse);
XS.Label(LabelTrue );
XS.Add(XSRegisters.OldToNewRegister(RegistersEnum.ESP), 4);
new Push { DestinationValue = 1 };

View file

@ -88,7 +88,7 @@ namespace Cosmos.IL2CPU.X86.IL
// add LEFT_LOW * RIGHT_HIGH + RIGHT_LOW + LEFT_HIGH to high dword of last result
XS.Add(XSRegisters.OldToNewRegister(RegistersEnum.EDX), XSRegisters.OldToNewRegister(RegistersEnum.ECX));
new Jump { DestinationLabel = MoveReturnValue };
XS.Jump(MoveReturnValue);
XS.Label(Simple32Multiply);
//mov RIGHT_LOW to eax

View file

@ -88,7 +88,7 @@ namespace Cosmos.IL2CPU.X86.IL
// add LEFT_LOW * RIGHT_HIGH + RIGHT_LOW + LEFT_HIGH to high dword of last result
XS.Add(XSRegisters.OldToNewRegister(RegistersEnum.EDX), XSRegisters.OldToNewRegister(RegistersEnum.ECX));
new Jump { DestinationLabel = MoveReturnValue };
XS.Jump(MoveReturnValue);
XS.Label(Simple32Multiply);
//mov RIGHT_LOW to eax