mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2024-11-14 23:05:32 +00:00
ea82c58777
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
33 lines
796 B
C#
33 lines
796 B
C#
// <copyright file="IntelOpCodeDecoded.cs" company="Adrian Conlon">
|
|
// Copyright (c) Adrian Conlon. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace EightBit
|
|
{
|
|
public class IntelOpCodeDecoded
|
|
{
|
|
public IntelOpCodeDecoded()
|
|
{
|
|
}
|
|
|
|
public IntelOpCodeDecoded(byte opCode)
|
|
{
|
|
this.X = (opCode & 0b11000000) >> 6; // 0 - 3
|
|
this.Y = (opCode & 0b00111000) >> 3; // 0 - 7
|
|
this.Z = opCode & 0b00000111; // 0 - 7
|
|
this.P = (this.Y & 0b110) >> 1; // 0 - 3
|
|
this.Q = this.Y & 1; // 0 - 1
|
|
}
|
|
|
|
public int X { get; }
|
|
|
|
public int Y { get; }
|
|
|
|
public int Z { get; }
|
|
|
|
public int P { get; }
|
|
|
|
public int Q { get; }
|
|
}
|
|
}
|