Added NOT Instruction

This commit is contained in:
simon 2017-11-11 15:27:06 -05:00
parent 3d9bfb2a42
commit 1a6f92a29d
3 changed files with 22 additions and 0 deletions

View File

@ -36,6 +36,7 @@ public class DefaultInstructionSet implements InstructionSet {
add(new TestInstruction()); add(new TestInstruction());
add(new CmpInstruction()); add(new CmpInstruction());
add(new NegInstruction()); add(new NegInstruction());
add(new NotInstruction());
} }
/** /**

View File

@ -0,0 +1,21 @@
package net.simon987.server.assembly.instruction;
import net.simon987.server.assembly.Instruction;
import net.simon987.server.assembly.Status;
import net.simon987.server.assembly.Target;
public class NotInstruction extends Instruction {
public static final int OPCODE = 29;
public NotInstruction() {
super("not", OPCODE);
}
@Override
public Status execute(Target dst, int dstIndex, Status status) {
dst.set(dstIndex, ~dst.get(dstIndex));
return status;
}
}

Binary file not shown.