2019-02-04 23:52:21 +00:00
|
|
|
|
// <copyright file="IntelOpCodeDecoded.cs" company="Adrian Conlon">
|
|
|
|
|
// Copyright (c) Adrian Conlon. All rights reserved.
|
|
|
|
|
// </copyright>
|
|
|
|
|
|
|
|
|
|
namespace EightBit
|
2019-02-02 15:12:51 +00:00
|
|
|
|
{
|
2019-02-04 23:52:21 +00:00
|
|
|
|
public class IntelOpCodeDecoded
|
2019-02-02 15:12:51 +00:00
|
|
|
|
{
|
2019-02-04 23:52:21 +00:00
|
|
|
|
private int x;
|
|
|
|
|
private int y;
|
|
|
|
|
private int z;
|
|
|
|
|
private int p;
|
|
|
|
|
private int q;
|
2019-02-02 15:12:51 +00:00
|
|
|
|
|
2019-02-04 23:52:21 +00:00
|
|
|
|
public IntelOpCodeDecoded()
|
|
|
|
|
{
|
|
|
|
|
}
|
2019-02-02 15:12:51 +00:00
|
|
|
|
|
2019-02-14 23:01:31 +00:00
|
|
|
|
public IntelOpCodeDecoded(byte opCode)
|
2019-02-03 21:13:06 +00:00
|
|
|
|
{
|
2019-02-14 23:01:31 +00:00
|
|
|
|
this.x = (opCode & 0b11000000) >> 6; // 0 - 3
|
|
|
|
|
this.y = (opCode & 0b00111000) >> 3; // 0 - 7
|
|
|
|
|
this.z = opCode & 0b00000111; // 0 - 7
|
2019-02-04 23:52:21 +00:00
|
|
|
|
this.p = (this.y & 0b110) >> 1; // 0 - 3
|
|
|
|
|
this.q = this.y & 1; // 0 - 1
|
2019-02-03 21:13:06 +00:00
|
|
|
|
}
|
2019-02-02 15:12:51 +00:00
|
|
|
|
}
|
|
|
|
|
}
|