Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mterwoord committed Jun 16, 2016
1 parent 9f3199a commit be7b8a2
Show file tree
Hide file tree
Showing 32 changed files with 88 additions and 231 deletions.
2 changes: 1 addition & 1 deletion Tests/Cosmos.TestRunner.Core/Engine.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.ComponentModel;
Expand Down
162 changes: 27 additions & 135 deletions Users/Orvid/OrvidTestOS/AsmMouse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ private class EnableMouseASM : AssemblerMethod

public override void AssembleNew(object aAssembler, object aMethodInfo)
{
new Move
{
DestinationReg = RegistersEnum.BL,
SourceValue = 0xa8
};
XS.Mov(XSRegisters.BL, 0xa8);

new Call
{
Expand All @@ -41,11 +37,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)

new Noop();

new Move
{
DestinationReg = RegistersEnum.BL,
SourceValue = 0x20
};
XS.Mov(XSRegisters.BL, 0x20);

new Call
{
Expand All @@ -57,17 +49,9 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
DestinationLabel = "mouse_read"
};

new Or
{
DestinationReg = RegistersEnum.AL,
SourceValue = 3
};
XS.Or(XSRegisters.AL, 3);

new Move
{
DestinationReg = RegistersEnum.BL,
SourceValue = 0x60
};
XS.Mov(XSRegisters.BL, 0x60);

XS.Push(XSRegisters.EAX);

Expand All @@ -85,22 +69,14 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)

new Noop();

new Move
{
DestinationReg = RegistersEnum.BL,
SourceValue = 0xd4
};
XS.Mov(XSRegisters.BL, 0xd4);

new Call
{
DestinationLabel = "send_mouse_cmd"
};

new Move
{
DestinationReg = RegistersEnum.AL,
SourceValue = 0xf4
};
XS.Mov(XSRegisters.AL, 0xf4);

new Call
{
Expand All @@ -119,11 +95,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)

XS.Push(XSRegisters.EDX);

new Move
{
DestinationReg = RegistersEnum.ECX,
SourceValue = 0xffff
};
XS.Mov(XSRegisters.ECX, 0xffff);

XS.Label("mouse_read_loop");
{
Expand All @@ -134,11 +106,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
Size = 8
};

new Test
{
DestinationReg = RegistersEnum.AL,
SourceValue = 1
};
XS.Test(XSRegisters.AL, 1);

XS.Jump(ConditionalTestEnum.NotZero, "mouse_read_ready");

Expand All @@ -147,11 +115,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
DestinationLabel = "mouse_read_loop"
};

new Move
{
DestinationReg = RegistersEnum.AH,
SourceValue = 1
};
XS.Mov(XSRegisters.AH, 1);

XS.Jump("mouse_read_exit");
}
Expand All @@ -160,11 +124,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
{
XS.Push(XSRegisters.ECX);

new Move
{
DestinationReg = RegistersEnum.ECX,
SourceValue = 32
};
XS.Mov(XSRegisters.ECX, 32);
}

XS.Label("mouse_read_delay");
Expand Down Expand Up @@ -214,11 +174,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
SourceReg = RegistersEnum.AL
};

new Move
{
DestinationReg = RegistersEnum.ECX,
SourceValue = 0xffff
};
XS.Mov(XSRegisters.ECX, 0xffff);

XS.Label("mouse_write_loop1");
{
Expand All @@ -229,11 +185,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
Size = 8
};

new Test
{
DestinationReg = RegistersEnum.AL,
SourceValue = 32
};
XS.Test(XSRegisters.AL, 32);

XS.Jump(ConditionalTestEnum.Zero, "mouse_write_ok1");

Expand All @@ -242,11 +194,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
DestinationLabel = "mouse_write_loop1"
};

new Move
{
DestinationReg = RegistersEnum.AH,
SourceValue = 1
};
XS.Mov(XSRegisters.AH, 1);

XS.Jump("mouse_write_exit");
}
Expand All @@ -260,11 +208,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
Size = 8
};

new Move
{
DestinationReg = RegistersEnum.ECX,
SourceValue = 0xffff
};
XS.Mov(XSRegisters.ECX, 0xffff);
}

XS.Label("mouse_write_loop");
Expand All @@ -276,11 +220,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
Size = 8
};

new Test
{
DestinationReg = RegistersEnum.AL,
SourceValue = 2
};
XS.Test(XSRegisters.AL, 2);

XS.Jump(ConditionalTestEnum.Zero, "mouse_write_ok");

Expand All @@ -289,11 +229,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
DestinationLabel = "mouse_write_loop"
};

new Move
{
DestinationReg = RegistersEnum.AH,
SourceValue = 1
};
XS.Mov(XSRegisters.AH, 1);

XS.Jump("mouse_write_exit");
}
Expand All @@ -313,11 +249,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
Size = 8
};

new Move
{
DestinationReg = RegistersEnum.ECX,
SourceValue = 0xffff
};
XS.Mov(XSRegisters.ECX, 0xffff);
}

XS.Label("mouse_write_loop3");
Expand All @@ -329,11 +261,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
Size = 8
};

new Test
{
DestinationReg = RegistersEnum.AL,
SourceValue = 2
};
XS.Test(XSRegisters.AL, 2);

XS.Jump(ConditionalTestEnum.Zero, "mouse_write_ok3");

Expand All @@ -342,31 +270,19 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
DestinationLabel = "mouse_write_loop3"
};

new Move
{
DestinationReg = RegistersEnum.AH,
SourceValue = 1
};
XS.Mov(XSRegisters.AH, 1);

XS.Jump("mouse_write_exit");
}

XS.Label("mouse_write_ok3");
{
new Move
{
DestinationReg = RegistersEnum.AH,
SourceValue = 0x08
};
XS.Mov(XSRegisters.AH, 0x08);
}

XS.Label("mouse_write_loop4");
{
new Move
{
DestinationReg = RegistersEnum.ECX,
SourceValue = 0xffff
};
XS.Mov(XSRegisters.ECX, 0xffff);
}

XS.Label("mouse_write_loop5");
Expand All @@ -378,11 +294,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
Size = 8
};

new Test
{
DestinationReg = RegistersEnum.AL,
SourceValue = 1
};
XS.Test(XSRegisters.AL, 1);

XS.Jump(ConditionalTestEnum.NotZero, "mouse_write_ok4");

Expand Down Expand Up @@ -420,11 +332,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
XS.Label("send_mouse_cmd");
{

new Move
{
DestinationReg = RegistersEnum.ECX,
SourceValue = 0xffff
};
XS.Mov(XSRegisters.ECX, 0xffff);

XS.Label("mouse_cmd_wait");
{
Expand All @@ -434,11 +342,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
SourceValue = 0x64,
Size = 8
};
new Test
{
DestinationReg = RegistersEnum.AL,
SourceValue = 2
};
XS.Test(XSRegisters.AL, 2);
XS.Jump(ConditionalTestEnum.Zero, "mouse_cmd_send");
new Loop
{
Expand All @@ -465,11 +369,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
#endif
Size = 8
};
new Move
{
DestinationReg = RegistersEnum.ECX,
SourceValue = 0xffff
};
XS.Mov(XSRegisters.ECX, 0xffff);
}

XS.Label("mouse_cmd_accept");
Expand All @@ -480,11 +380,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)
SourceValue = 0x64,
Size = 8
};
new Test
{
DestinationReg = RegistersEnum.AL,
SourceValue = 0x02
};
XS.Test(XSRegisters.AL, 0x02);
XS.Jump(ConditionalTestEnum.Zero, "mouse_cmd_ok");
new Loop
{
Expand All @@ -494,11 +390,7 @@ public override void AssembleNew(object aAssembler, object aMethodInfo)

XS.Label("mouse_cmd_error");
{
new Move
{
DestinationReg = RegistersEnum.AH,
SourceValue = 0x01
};
XS.Mov(XSRegisters.AH, 0x01);
XS.Jump("mouse_cmd_exit");
}

Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.Build.MSBuild/IL2CPU.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.Core.Plugs/Assemblers/UpdateIDT.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Reflection;
using Cosmos.Assembler.x86.x87;
using Cosmos.IL2CPU.Plugs;
Expand Down
2 changes: 1 addition & 1 deletion source/Cosmos.Core.Plugs/CPUImpl.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Text;
using Cosmos.IL2CPU.Plugs;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Cosmos.IL2CPU.Plugs;
using Cosmos.IL2CPU.Plugs;
using XSharp.Compiler;
using CPUx86 = Cosmos.Assembler.x86;

Expand Down
Loading

0 comments on commit be7b8a2

Please sign in to comment.