switch (addr) {
case RR_ADDR:
stream.writeXCHG(getReg(0), getReg(1));
break;
case RE_ADDR:
Address ind = getAddress(1);
stream.writeXCHG(getRegister(ind.getImg()), ind.disp, getReg(0));
break;
case RA_ADDR:
stream.writeXCHG(getAddress(1).disp, getReg(0));
break;
case RG_ADDR:
ind = getAddress(1);
stream.writeXCHG((SR) X86Register.getRegister(ind.getImg()), ind.disp, getReg(0));
break;
case ER_ADDR:
ind = getAddress(0);
stream.writeXCHG(getRegister(ind.getImg()), ind.disp, getReg(1));
break;
case AR_ADDR:
stream.writeXCHG(getAddress(0).disp, getReg(1));
break;
case GR_ADDR:
ind = getAddress(0);
stream.writeXCHG((SR) X86Register.getRegister(ind.getImg()), ind.disp, getReg(1));
break;
default:
reportAddressingError(XCHG_ISN, addr);
}
}