Keil Logo

Modular Programming

The A166 Assembler allows the user to program in a modular fashion.

Many programs are too long or complex to write as a single module or source file. Programming becomes easier when the code is divided into small modules or files according to function. Modular programs are easier to code, debug, and change than monolithic programs.

For coding, the modular approach to programming is similar to a hardware design with numerous circuits. The device or program is logically divided into "black boxes" with specific input and output. Once the interfaces between the units are defined, the design of each unit can proceed separately. These modules are easier to understand, design, and test than large programs. With the module input and output defined, the programmer can supply the needed input and verify correctness of the module by examining the output. The linker then links the separate modules placed in an absolute executable single program module that can be tested.

In addition, code written for one program is often useful in others. Modular programming allows these sections to be saved for future use. Because the code is relocatable, saved modules can be linked to any program that fulfills the input and output requirements. With monolithic programming, such sections of code are buried inside the program and not available for use by other programs.

For debugging and modifying, problems can be isolated to specific modules. Once the faulty module is identified, fixing the problem is considerably easier. You can link new or debugged modules to an existing program with the confidence the rest of the program will not change.

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.