mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-23 06:18:54 +00:00
This commit is contained in:
parent
5e882b6182
commit
a0163de71d
6 changed files with 40 additions and 10 deletions
|
|
@ -37,7 +37,7 @@ namespace Indy.IL2CPU.Tests.Assembler.X86 {
|
|||
using (var xOut = new StringWriter()) {
|
||||
Assembler.FlushText(xOut);
|
||||
using (var xReader = new StreamReader(typeof(BaseTest).Assembly.GetManifestResourceStream(xManStreamName + ".asm"))) {
|
||||
Assert.AreEqual(xReader.ReadToEnd().Replace(' ', '_').Replace('\t', '_'), xOut.ToString().Replace(' ', '_').Replace('\t', '_'));
|
||||
Assert.AreEqual(xReader.ReadToEnd(), xOut.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,19 @@ namespace Indy.IL2CPU.Tests.Assembler.X86 {
|
|||
Verify();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestImmediateToRegister8() {
|
||||
new Move { DestinationReg = Registers.AL, SourceValue = 1 };
|
||||
new Move { DestinationReg = Registers.BL, SourceValue = 2 };
|
||||
new Move { DestinationReg = Registers.CL, SourceValue = 3 };
|
||||
new Move { DestinationReg = Registers.DL, SourceValue = 4 };
|
||||
new Move { DestinationReg = Registers.AH, SourceValue = 1 };
|
||||
new Move { DestinationReg = Registers.BH, SourceValue = 2 };
|
||||
new Move { DestinationReg = Registers.CH, SourceValue = 3 };
|
||||
new Move { DestinationReg = Registers.DH, SourceValue = 4 };
|
||||
Verify();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestImmediateToMemorySimple8() {
|
||||
new Move { Size = 8, DestinationReg = Registers.EAX, DestinationIsIndirect = true, SourceValue = 65 };
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
use32
|
||||
org 0x200000
|
||||
mov byte AL, 0x1
|
||||
mov byte BL, 0x2
|
||||
mov byte CL, 0x3
|
||||
mov byte DL, 0x4
|
||||
mov byte AH, 0x1
|
||||
mov byte BH, 0x2
|
||||
mov byte CH, 0x3
|
||||
mov byte DH, 0x4
|
||||
|
|
@ -0,0 +1 @@
|
|||
АГБВДЗЕЖ
|
||||
|
|
@ -73,6 +73,12 @@
|
|||
<ItemGroup>
|
||||
<EmbeddedResource Include="Assembler\X86\VerificationData\MoveTests\ImmediateToRegister16.bin" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Assembler\X86\VerificationData\MoveTests\ImmediateToRegister8.bin" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Assembler\X86\VerificationData\MoveTests\ImmediateToRegister8.asm" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#define BINARY
|
||||
//#define BINARY
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
|
@ -12,14 +12,14 @@ namespace TestApp {
|
|||
class Program {
|
||||
class Renderer : Y86 {
|
||||
public void DoRender() {
|
||||
new Move { DestinationReg = Registers.AX, SourceValue = 1 };
|
||||
new Move { DestinationReg = Registers.BX, SourceValue = 2 };
|
||||
new Move { DestinationReg = Registers.CX, SourceValue = 3 };
|
||||
new Move { DestinationReg = Registers.DX, SourceValue = 4 };
|
||||
new Move { DestinationReg = Registers.SI, SourceValue = 5 };
|
||||
new Move { DestinationReg = Registers.DI, SourceValue = 6 };
|
||||
new Move { DestinationReg = Registers.SP, SourceValue = 6 };
|
||||
new Move { DestinationReg = Registers.BP, SourceValue = 6 };
|
||||
new Move { DestinationReg = Registers.AL, SourceValue = 1 };
|
||||
new Move { DestinationReg = Registers.BL, SourceValue = 2 };
|
||||
new Move { DestinationReg = Registers.CL, SourceValue = 3 };
|
||||
new Move { DestinationReg = Registers.DL, SourceValue = 4 };
|
||||
new Move { DestinationReg = Registers.AH, SourceValue = 1 };
|
||||
new Move { DestinationReg = Registers.BH, SourceValue = 2 };
|
||||
new Move { DestinationReg = Registers.CH, SourceValue = 3 };
|
||||
new Move { DestinationReg = Registers.DH, SourceValue = 4 };
|
||||
}
|
||||
}
|
||||
static void Main(string[] args) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue