@Nonnull private BuilderInstruction22t newBuilderInstruction22t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction22t instruction) { return new BuilderInstruction22t( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
private BuilderInstruction buildInstruction22t(Opcode opcode, int offset) { BuilderInstruction instruction = mock(BuilderInstruction.class, withSettings().extraInterfaces(Instruction22t.class)); when(location.getInstruction()).thenReturn(instruction); when(instruction.getLocation()).thenReturn(location); when(instruction.getCodeUnits()).thenReturn(0); when(instruction.getOpcode()).thenReturn(opcode); when(((Instruction22t) instruction).getRegisterA()).thenReturn(ARG1_REGISTER); when(((Instruction22t) instruction).getRegisterB()).thenReturn(ARG2_REGISTER); when(((Instruction22t) instruction).getCodeOffset()).thenReturn(offset); return instruction; }
@Nonnull private BuilderInstruction22t newBuilderInstruction22t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction22t instruction) { return new BuilderInstruction22t( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
@Nonnull private BuilderInstruction22t newBuilderInstruction22t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction22t instruction) { return new BuilderInstruction22t( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
@Nonnull private BuilderInstruction22t newBuilderInstruction22t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction22t instruction) { return new BuilderInstruction22t( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
@Nonnull private BuilderInstruction22t newBuilderInstruction22t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction22t instruction) { return new BuilderInstruction22t( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
public static ImmutableInstruction22t of(Instruction22t instruction) { if (instruction instanceof ImmutableInstruction22t) { return (ImmutableInstruction22t)instruction; } return new ImmutableInstruction22t( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), instruction.getCodeOffset()); }
public static ImmutableInstruction22t of(Instruction22t instruction) { if (instruction instanceof ImmutableInstruction22t) { return (ImmutableInstruction22t)instruction; } return new ImmutableInstruction22t( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), instruction.getCodeOffset()); }
public static ImmutableInstruction22t of(Instruction22t instruction) { if (instruction instanceof ImmutableInstruction22t) { return (ImmutableInstruction22t)instruction; } return new ImmutableInstruction22t( instruction.getOpcode(), instruction.getRegisterA(), instruction.getRegisterB(), instruction.getCodeOffset()); }
public void write(@Nonnull Instruction22t instruction) { try { writer.write(instruction.getOpcode().value); writer.write(packNibbles(instruction.getRegisterA(), instruction.getRegisterB())); writer.writeShort(instruction.getCodeOffset()); } catch (IOException ex) { throw new RuntimeException(ex); } }
public void write(@Nonnull Instruction22t instruction) { try { writer.write(getOpcodeValue(instruction.getOpcode())); writer.write(packNibbles(instruction.getRegisterA(), instruction.getRegisterB())); writer.writeShort(instruction.getCodeOffset()); } catch (IOException ex) { throw new RuntimeException(ex); } }
public void write(@Nonnull Instruction22t instruction) { try { writer.write(getOpcodeValue(instruction.getOpcode())); writer.write(packNibbles(instruction.getRegisterA(), instruction.getRegisterB())); writer.writeShort(instruction.getCodeOffset()); } catch (IOException ex) { throw new RuntimeException(ex); } }
break; case IF_EQ: instructions.add(new Branch.BinaryBranch(instLoc, ((Instruction22t)inst).getCodeOffset(), Branch.BinaryBranch.CompareOp.EQ, ((Instruction22t)inst).getRegisterA(), ((Instruction22t)inst).getRegisterB(), inst.getOpcode(), this)); break; case IF_NE: instructions.add(new Branch.BinaryBranch(instLoc, ((Instruction22t)inst).getCodeOffset(), Branch.BinaryBranch.CompareOp.NE, ((Instruction22t)inst).getRegisterA(), ((Instruction22t)inst).getRegisterB(), inst.getOpcode(), this)); break; case IF_LT: instructions.add(new Branch.BinaryBranch(instLoc, ((Instruction22t)inst).getCodeOffset(), Branch.BinaryBranch.CompareOp.LT, ((Instruction22t)inst).getRegisterA(), ((Instruction22t)inst).getRegisterB(), inst.getOpcode(), this)); break; case IF_GE: instructions.add(new Branch.BinaryBranch(instLoc, ((Instruction22t)inst).getCodeOffset(), Branch.BinaryBranch.CompareOp.GE, ((Instruction22t)inst).getRegisterA(), ((Instruction22t)inst).getRegisterB(), inst.getOpcode(), this)); break; case IF_GT: instructions.add(new Branch.BinaryBranch(instLoc, ((Instruction22t)inst).getCodeOffset(), Branch.BinaryBranch.CompareOp.GT, ((Instruction22t)inst).getRegisterA(), ((Instruction22t)inst).getRegisterB(), inst.getOpcode(), this)); break; case IF_LE: instructions.add(new Branch.BinaryBranch(instLoc, ((Instruction22t)inst).getCodeOffset(), Branch.BinaryBranch.CompareOp.LE, ((Instruction22t)inst).getRegisterA(),
break; case IF_EQ: instructions.add(new Branch.BinaryBranch(instLoc, ((Instruction22t)inst).getCodeOffset(), Branch.BinaryBranch.CompareOp.EQ, ((Instruction22t)inst).getRegisterA(), ((Instruction22t)inst).getRegisterB(), inst.getOpcode(), this)); break; case IF_NE: instructions.add(new Branch.BinaryBranch(instLoc, ((Instruction22t)inst).getCodeOffset(), Branch.BinaryBranch.CompareOp.NE, ((Instruction22t)inst).getRegisterA(), ((Instruction22t)inst).getRegisterB(), inst.getOpcode(), this)); break; case IF_LT: instructions.add(new Branch.BinaryBranch(instLoc, ((Instruction22t)inst).getCodeOffset(), Branch.BinaryBranch.CompareOp.LT, ((Instruction22t)inst).getRegisterA(), ((Instruction22t)inst).getRegisterB(), inst.getOpcode(), this)); break; case IF_GE: instructions.add(new Branch.BinaryBranch(instLoc, ((Instruction22t)inst).getCodeOffset(), Branch.BinaryBranch.CompareOp.GE, ((Instruction22t)inst).getRegisterA(), ((Instruction22t)inst).getRegisterB(), inst.getOpcode(), this)); break; case IF_GT: instructions.add(new Branch.BinaryBranch(instLoc, ((Instruction22t)inst).getCodeOffset(), Branch.BinaryBranch.CompareOp.GT, ((Instruction22t)inst).getRegisterA(), ((Instruction22t)inst).getRegisterB(), inst.getOpcode(), this)); break; case IF_LE: instructions.add(new Branch.BinaryBranch(instLoc, ((Instruction22t)inst).getCodeOffset(), Branch.BinaryBranch.CompareOp.LE, ((Instruction22t)inst).getRegisterA(),