Files
EightBitNet/EightBit/IntelOpCodeDecoded.cs
2024-10-09 20:05:37 +01:00

29 lines
706 B
C#

// <copyright file="IntelOpCodeDecoded.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace EightBit
{
public sealed class IntelOpCodeDecoded
{
public IntelOpCodeDecoded(byte opCode)
{
X = (opCode & 0b11000000) >> 6; // 0 - 3
Y = (opCode & 0b00111000) >> 3; // 0 - 7
Z = opCode & 0b00000111; // 0 - 7
P = (Y & 0b110) >> 1; // 0 - 3
Q = Y & 1; // 0 - 1
}
public int X { get; }
public int Y { get; }
public int Z { get; }
public int P { get; }
public int Q { get; }
}
}