diff --git a/Users/Orvid/OrvidTestOS/AsmMouse.cs b/Users/Orvid/OrvidTestOS/AsmMouse.cs index 4e18a8666..973bfee77 100644 --- a/Users/Orvid/OrvidTestOS/AsmMouse.cs +++ b/Users/Orvid/OrvidTestOS/AsmMouse.cs @@ -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"); diff --git a/source/Cosmos.IL2CPU/AppAssembler.cs b/source/Cosmos.IL2CPU/AppAssembler.cs index 642addffb..f7a2286b7 100644 --- a/source/Cosmos.IL2CPU/AppAssembler.cs +++ b/source/Cosmos.IL2CPU/AppAssembler.cs @@ -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) diff --git a/source/Cosmos.IL2CPU/CosmosAssembler.cs b/source/Cosmos.IL2CPU/CosmosAssembler.cs index 2ff0a4a1e..892e66a08 100644 --- a/source/Cosmos.IL2CPU/CosmosAssembler.cs +++ b/source/Cosmos.IL2CPU/CosmosAssembler.cs @@ -361,10 +361,7 @@ namespace Cosmos.IL2CPU XS.Label(".loop"); new ClearInterruptFlag(); new Halt(); - new Jump - { - DestinationLabel = ".loop" - }; + XS.Jump(".loop"); if (mComPort > 0) { diff --git a/source/Cosmos.IL2CPU/IL/Ceq.cs b/source/Cosmos.IL2CPU/IL/Ceq.cs index deb5fb569..12004f4f3 100644 --- a/source/Cosmos.IL2CPU/IL/Ceq.cs +++ b/source/Cosmos.IL2CPU/IL/Ceq.cs @@ -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); diff --git a/source/Cosmos.IL2CPU/IL/Cgt.cs b/source/Cosmos.IL2CPU/IL/Cgt.cs index 34211c9f0..594066563 100644 --- a/source/Cosmos.IL2CPU/IL/Cgt.cs +++ b/source/Cosmos.IL2CPU/IL/Cgt.cs @@ -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 }; diff --git a/source/Cosmos.IL2CPU/IL/Cgt_Un.cs b/source/Cosmos.IL2CPU/IL/Cgt_Un.cs index ee3b7725a..c43eb44ba 100644 --- a/source/Cosmos.IL2CPU/IL/Cgt_Un.cs +++ b/source/Cosmos.IL2CPU/IL/Cgt_Un.cs @@ -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 }; diff --git a/source/Cosmos.IL2CPU/IL/Clt.cs b/source/Cosmos.IL2CPU/IL/Clt.cs index 1b6b601ae..9bf8a8024 100644 --- a/source/Cosmos.IL2CPU/IL/Clt.cs +++ b/source/Cosmos.IL2CPU/IL/Clt.cs @@ -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 }; diff --git a/source/Cosmos.IL2CPU/IL/Clt_Un.cs b/source/Cosmos.IL2CPU/IL/Clt_Un.cs index f52b68592..4aa29517b 100644 --- a/source/Cosmos.IL2CPU/IL/Clt_Un.cs +++ b/source/Cosmos.IL2CPU/IL/Clt_Un.cs @@ -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 }; diff --git a/source/Cosmos.IL2CPU/IL/Mul_Ovf.cs b/source/Cosmos.IL2CPU/IL/Mul_Ovf.cs index e2bffd913..d8dcce5e3 100644 --- a/source/Cosmos.IL2CPU/IL/Mul_Ovf.cs +++ b/source/Cosmos.IL2CPU/IL/Mul_Ovf.cs @@ -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 diff --git a/source/Cosmos.IL2CPU/IL/Mul_Ovf_Un.cs b/source/Cosmos.IL2CPU/IL/Mul_Ovf_Un.cs index 9ed7c362b..3305f1e8f 100644 --- a/source/Cosmos.IL2CPU/IL/Mul_Ovf_Un.cs +++ b/source/Cosmos.IL2CPU/IL/Mul_Ovf_Un.cs @@ -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