To copy from ST(0) to ST(i), I've figured out that fst ST(i) works.
How do I copy values from ST(i) to ST(0), without affecting other ST(...) registers or the stack? I could come up with fxch ST(i) followed by fst ST(i). Is there a single-instruction version?
More Google searches haven't revealed single-instruction solution, so it's only
fxch+fst. The instructionfldis not relevant, it isn't able to copy between two registers without touching other registers (as part of the stack).Thus:
fst ST(i).fxch ST(i)followed byfst ST(i).fxch ST(i)followed byfst ST(j)followed byfxch ST(i).fxch ST(i).fxch ST(i)followed byfxch ST(j)followed byfxch ST(i).