1 package net.mograsim.machine.isa;
3 import java.util.Objects;
5 public final class AsmInstruction implements AsmElement
7 private final AsmOperation operation;
8 private final AsmOperands operands;
10 public AsmInstruction(AsmOperation operation, AsmOperands operands)
12 this.operation = Objects.requireNonNull(operation);
13 this.operands = Objects.requireNonNull(operands);
19 return Objects.hash(operands, operation);
23 public boolean equals(Object obj)
27 if (!(obj instanceof AsmInstruction))
29 AsmInstruction other = (AsmInstruction) obj;
30 return Objects.equals(operands, other.operands) && Objects.equals(operation, other.operation);
34 public String toString()
36 return String.format("%s %s", operation, operands).trim();