On 14 February 2012 17:41, robin <[email protected]> wrote: > From: Peter Relson <[email protected]> > To: [email protected] <[email protected]> > Date: Tuesday, 14 February 2012 4:26 > > >>Some of this discussion revolves around what the "base knowledge" is that >>you expect/require that the code's readers have. >> >>If "everyone" understands that "SR regx,regx" and "XR regx,regx" zero >>regx then there is little to no benefit to having a macro that is "ZERO >>regx". > > If so, there's be little need for comments such as the example > >>> XR R5,R5 zeroise R5 > > Something sensible like > ZERO 5 > makes it absolutely clear, and soes not need a "clarifying" remark.
It depends greatly on the context. If, in looking at code I wasn't familiar with, I encountered such a macro call, I would have to spend some time making sure that I understood both its intent and implementation well. Such a macro could well be badly designed, or could mean something quite different from its "obvious" meaning. What if instead of zeroing R5, it instead asserts that R5 contains 0, and abends if it doesn't? The author might well argue that having a macro to simply clear a register is silly, burdens the name space, and so on, but that having one to do an assert is useful. Tony H.
