private void ReplaceOperands(Operand target, Operand replacement)
{
for (int i = 0; i < OperandCount; i++)
{
var operand = GetOperand(i);
if (target == operand)
{
SetOperand(i, replacement);
}
}
for (int i = 0; i < ResultCount; i++)
{
var operand = GetResult(i);
if (target == operand)
{
SetResult(i, replacement);
}
}
}