mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-27 22:12:25 +00:00
[*] Fixed comment on JumpIfAbove [+] JumpIfAboveOrEqual to handle jae [*] Fixed comment on JumpOnGreater
75 lines
1.4 KiB
C#
75 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Indy.IL2CPU.Assembler.X86
|
|
{
|
|
[Serializable]
|
|
public enum Condition
|
|
{
|
|
/// <summary>
|
|
/// DEST > SOURCE (signed)
|
|
/// </summary>
|
|
Greater,
|
|
/// <summary>
|
|
/// DEST >= SOURCE (singed)
|
|
/// </summary>
|
|
GreaterOrEqual,
|
|
/// <summary>
|
|
/// DEST < SOURCE (signed)
|
|
/// </summary>
|
|
Less,
|
|
/// <summary>
|
|
/// DEST <= SOURCE (signed)
|
|
/// </summary>
|
|
LessOrEqual,
|
|
|
|
/// <summary>
|
|
/// DEST > SOURCE (unsigned)
|
|
/// </summary>
|
|
Above,
|
|
/// <summary>
|
|
/// DEST >= SOURCE (unsigned)
|
|
/// </summary>
|
|
AboveOrEqual,
|
|
/// <summary>
|
|
/// DEST < SOURCE (unsigned)
|
|
/// </summary>
|
|
Below,
|
|
/// <summary>
|
|
/// DEST <= SOURCE (unsigned)
|
|
/// </summary>
|
|
BelowOrEqual,
|
|
}
|
|
|
|
public static class ConditionHelperExt
|
|
{
|
|
public static string GetMnemonics(this Condition condition)
|
|
{
|
|
switch (condition)
|
|
{
|
|
case Condition.Above:
|
|
return "a";
|
|
case Condition.AboveOrEqual:
|
|
return "ae";
|
|
case Condition.Below:
|
|
return "b";
|
|
case Condition.BelowOrEqual:
|
|
return "be";
|
|
|
|
case Condition.Greater:
|
|
return "g";
|
|
case Condition.GreaterOrEqual:
|
|
return "ge";
|
|
case Condition.Less:
|
|
return "l";
|
|
case Condition.LessOrEqual:
|
|
return "le";
|
|
|
|
default:
|
|
throw new NotSupportedException();
|
|
}
|
|
}
|
|
}
|
|
}
|