A macro is a tool of the programmer with helpful properties. (1) A block of code that is repeated in multiple locations in a program can be placed in a macro. Then a call to the macro replaces each of the redundant block of code. The result is a cleaner and neater source file. Furthermore, should that block require maintenance in the future, the maintainer needs to upgrade only one block of code -- not multiple copies of a single block. (2) A block of code, not central to the purpose of a function, may be offloaded to a macro. A call to the macro replaces the block. The result is more readable source code.
Macros have these advantages:
No setup block
No requirement to remain on the 16-byte boundary
No additional memory usage as activation records
No additional overhead in time required to create and remove activation records
A block that appears in a source file in multiple locations can be replaced by calls to a single macro. This improves maintainability by programming once and executing multiple times.
Offloads code blocks that are not central to the theme of the enclosing function.
The education purpose of this program is to show how to improve the readability, maintainability, and speed of execution of an ordinary application program. The sample program is sufficiently clear in its use of macros so that students of programming will soon be able to use macros in their own programs.