7.1 Run-Time Storage Allocation

Before we discuss Code Generation phase of a compiler, we should be aware of how the code and data are stored in the memory of the computer at run-time. In case of embedded systems, where the computer is a part of a complete device, instrument or system, the program resides permanently in a non-volatile memory.

For small, one-time applications a load-and-go scheme shown in Fig. 7.3 may be used, where the source code editor, compiler and/or interpreter, the run-time library and the user's application program – both its source code version and translated version – all reside in the main memory of the computer.

 

 

Fig. 7.3 Load-and-Go scheme. Left-hand side shows compiler-based (e.g. Turbo-Pascal) and right-hand ...

Get Compilers: Principles and Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.