final GPR r = addr.getRegister();
final GPR valr = val.getRegister();
final GPR ofsr = ofs.getRegister();
os.writeLEA(r, r, ofsr, 1, 0);
os.writeCMPXCHG_EAX(r, 0, valr, true);
os.writeSETCC(resultr, X86Constants.JZ);
os.writeAND(resultr, 0xFF);
ofs.release(ec);
val.release(ec);
old.release(ec);