Professional Documents
Culture Documents
BY
GHULAM GHOSE 410
LIYA NAZEER 405
SO WHAT ARE WE TALKING ABOUT
HERE?
• How do your code and data look like during execution?
• Interaction among compiler, OS, and target machine
• The main two themes:
– Allocation of storage locations
– Access to variables and data
INTRODUCTION
• A program as a source code is merely a collection of text code, statements etc.
and to make it alive, it requires actions to be performed on the target machine.
• It needs memory resources to execute instructions.
• It contains names for procedures, identifiers etc., that require mapping with the
actual memory location at runtime.
• Runtime environment is a state of the target machine, which may include
software libraries, environment variables etc.
SOURCE CODE TO EXECUTION
LIBRARY
Linker
LOADER EXECUTABLE
DLL
RUN-TIME RESOURCES
• Execution of a program is initially under the control of the operating
system(OS).
• When a program is invoked:
– The OS allocates space for the program
– The code is loaded into part of this space
– The OS jumps to the entry point of the program
(i.e., to the beginning of the “main” function)
TYPICAL MEMORY SUBDIVISION
Low Address
CODE
Memory
Other Spaces
High Address
ORGANIZATION OF CODE SPACE
……
It is the text part of a program that does not change at runtime. Its memory
requirements are known at the compile time.
ASSUMPTION ABOUT FLOW OF CONTROL
Whenever a procedure is executed, its activation record is stored on the stack, also
known as control stack. When a procedure calls another procedure, the execution
of the caller is suspended until the called procedure finishes execution. At this
time, the activation record of the called procedure is stored on the stack.
When a called procedure is executed, it returns the control back to the caller. This
type of control flow makes it easier to represent a series of activations in the form
of a tree, known as the ACTIVATION TREE.
CONT…
To understand this concept, we take a piece of code as an example:
...