> I don't question the value of using macro-driven machinery for > generating the code to emulate instructions. However, in OCO code, > coping with the unavailability of machine instructions must be done > at run time, not at assembly time.
Only sort of. Depending on the code, you could have an initialization routine that determines if the required facility is available and then loads the appropriate version of the code or even modifies it prior to execution. Storing into an instruction stream is generally frowned upon, but it depends on the application -- will the code, if resident, sit unexecuted long enough for it to be flushed from the cache before being executed, and even if not, will the performance hit of the first execution be so substantial as to negate the benefit of subsequent execution(s)? If you replace a series of several instruction with one instruction, will you have to branch past the unused bytes, or fill them with Nops? There are many things that may need to be addressed, but sometimes that's better than dismissing the approach out of hand. - mb
