mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-12-13 14:49:03 +00:00
Added NOT Instruction
This commit is contained in:
@@ -36,6 +36,7 @@ public class DefaultInstructionSet implements InstructionSet {
|
||||
add(new TestInstruction());
|
||||
add(new CmpInstruction());
|
||||
add(new NegInstruction());
|
||||
add(new NotInstruction());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user