mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-19 10:36:43 +00:00
Added NOT Instruction
This commit is contained in:
parent
3d9bfb2a42
commit
1a6f92a29d
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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.
Loading…
x
Reference in New Issue
Block a user