mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-01 05:40:29 +00:00
85 lines
2.9 KiB
C#
85 lines
2.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using NUnit.Framework;
|
|
using Indy.IL2CPU.Assembler.X86;
|
|
|
|
namespace Indy.IL2CPU.Tests.Assembler.X86
|
|
{
|
|
[TestFixture]
|
|
public class PopTests : BaseTest
|
|
{
|
|
/*
|
|
* situations to cover:
|
|
* Top of stack to segment register is not used
|
|
* top of stack to memory (32 bit)
|
|
* top of stack to general register (32 bit)
|
|
* 16 bit is commented but not covered for now
|
|
* NB: CS cannot be used
|
|
*/
|
|
//[Test]
|
|
//public void SegmentRegisters()
|
|
//{
|
|
// new Pop { DestinationReg = Registers.DS };
|
|
// new Pop { DestinationReg = Registers.ES };
|
|
// new Pop { DestinationReg = Registers.SS };
|
|
// new Pop { DestinationReg = Registers.FS };
|
|
// new Pop { DestinationReg = Registers.GS };
|
|
// Verify();
|
|
//}
|
|
|
|
[Test]
|
|
public void MemorySimple32() {
|
|
new Pop { DestinationValue = 0x41, DestinationIsIndirect = true };
|
|
}
|
|
|
|
[Test]
|
|
public void Registers32()
|
|
{
|
|
new Pop { DestinationReg = Registers.EAX };
|
|
new Pop { DestinationReg = Registers.EBX };
|
|
new Pop { DestinationReg = Registers.ECX };
|
|
new Pop { DestinationReg = Registers.EDX };
|
|
new Pop { DestinationReg = Registers.EDI };
|
|
new Pop { DestinationReg = Registers.ESI };
|
|
new Pop { DestinationReg = Registers.ESP };
|
|
new Pop { DestinationReg = Registers.EBP };
|
|
Verify();
|
|
}
|
|
|
|
[Test]
|
|
public void Memory32BitOffset32()
|
|
{
|
|
/*changed Pop to Instruction without size
|
|
new Pop { Size = 16, DestinationIsIndirect = true};
|
|
*/
|
|
new Pop { DestinationIsIndirect = true, DestinationDisplacement = 70000, DestinationValue = 65 };
|
|
Verify();
|
|
}
|
|
|
|
[Test]
|
|
public void Memory16BitOffset32()
|
|
{
|
|
/*changed Pop to Instruction without size
|
|
new Pop { Size = 16, DestinationIsIndirect = true};
|
|
*/
|
|
new Pop { DestinationIsIndirect = true, DestinationDisplacement = 203, DestinationValue = 65 };
|
|
Verify();
|
|
}
|
|
|
|
/*[Test]
|
|
public void Registers16()
|
|
{
|
|
new Pop { DestinationReg = Registers.AX };
|
|
new Pop { DestinationReg = Registers.BX };
|
|
new Pop { DestinationReg = Registers.CX };
|
|
new Pop { DestinationReg = Registers.DX };
|
|
new Pop { DestinationReg = Registers.DI };
|
|
new Pop { DestinationReg = Registers.SI };
|
|
new Pop { DestinationReg = Registers.BP };
|
|
new Pop { DestinationReg = Registers.SP };
|
|
Verify();
|
|
}*/
|
|
}
|
|
}
|