mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2024-12-23 17:31:33 +00:00
63db46a7bc
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
29 lines
757 B
C#
29 lines
757 B
C#
// <copyright file="IntelOpCodeDecoded.cs" company="Adrian Conlon">
|
|
// Copyright (c) Adrian Conlon. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace EightBit
|
|
{
|
|
public class IntelOpCodeDecoded
|
|
{
|
|
private int x;
|
|
private int y;
|
|
private int z;
|
|
private int p;
|
|
private int q;
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|