On Mon, Aug 23, 2010 at 2:56 AM, John McKown <[email protected]> wrote:
Your points make a lot of sense, and I think every programmer should have such a rationale to motivate choices he makes in programming. > 1) KISS - when possible, use simply to understand instructions. Just to > be kind to yourself and others who will come later. Don't do the > following, even though it is "neat". I've seen this argument being abused too often. Simply the fact that the programmer did not think about it when he wrote the code does not mean someone reading the code later does not have to think about it either. Along those lines are redundant instructions "added for clarity" like an LTR when the instruction that set the register already sets condition code. Sure, it does take some effort to change things when you find that your initial choice of registers was unlucky. One I found in my inherited code is using a LM to load length and address, and then use 3 XR instructions to swap the registers so you can do a MVCL. A straight path is so much easier to follow. | Rob
