Skip to content

Commit

Permalink
fixed CPI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Writwick Das committed Oct 11, 2017
1 parent 4ae525a commit 4dbc886
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion One X/One X/Instruction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@ public OPCODE GetOPCODE() {
}

public static Instruction parse(string instr) {
string s = string.Empty;
if (instr.Contains(",")) {
s = ",";
} else {
s = " ";
}
try {
var inst = ((OPCODE[])Enum.GetValues(typeof(OPCODE))).
First(x => !string.IsNullOrWhiteSpace(x.GetAttributeOfType<Instruction>().Name) &&
instr.StartsWith(x.GetAttributeOfType<Instruction>().Name)).GetAttributeOfType<Instruction>();
instr.StartsWith(x.GetAttributeOfType<Instruction>().Name + s)).GetAttributeOfType<Instruction>();

if (inst.Bytes > 1) {
if (inst.Name.Contains(" ")) {
Expand Down

0 comments on commit 4dbc886

Please sign in to comment.