The Wayback Machine - https://web.archive.org/web/20240913172518/https://www.geeksforgeeks.org/run-time-storage-organization/
Open In App

Run-time Storage Organization

Last Updated : 21 May, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

The run-time environment is the structure of the target computers registers and memory that serves to manage memory and maintain information needed to guide a programs execution process.

Types of Runtime Environments –

  1. Fully Static :
    Fully static runtime environment may be useful for the languages in which pointers or dynamic allocation is not possible in addition to no support for recursive function calls.

    • Every procedure will have only one activation record which is allocated before execution.
    • Variables are accessed directly via fixed address.
    • Little bookkeeping overhead; i.e., at most return address may have to be stored in activation record.
    • The calling sequence involves the calculation of each argument address and storing into its appropriate parameter location and saving the return address and then a jump is made.

  2. Stack Based :
    In this, activation records are allocated (push of the activation record) whenever a function call is made. The necessary memory is taken from the stack portion of the program. When program execution return from the function the memory used by the activation record is deallocated (pop of the activation record). Thus, the stack grows and shrinks with the chain of function calls.


  3. Fully Dynamic :
    Functional language such as Lisp, ML, etc. use this style of call stack management. Silently, here activation record is deallocated only when all references to them have disappeared, and this requires the activation records to dynamically freed at arbitrary times during execution. Memory manager (garbage collector) is needed.

    The data structure that handles such management is heap an this is also called as Heap Management.

Activation Record –
Information needed by a single execution of a procedure is managed using a contiguous block of storage called “activation record”.

An activation record is allocated when a procedure is entered and it is deallocated when that procedure is exited. It contain temporary data, local data, machine status, optional access link, optional control link, actual parameters and returned values.

  • Program Counter (PC) – whose value is the address of the next instruction to be executed.
  • Stack Pointer (SP) – whose value is the top of the (top of the stack, ToS).
  • Frame pointer (FP) – which points to the current activation.

Note:
Activation records are allocated from one of static area (like Fortran 77), stack area (like C or Pascal) and heap area (like lisp).



Similar Reads

Computer Organization | Amdahl's law and its proof
It is named after computer scientist Gene Amdahl( a computer architect from IBM and Amdahl corporation) and was presented at the AFIPS Spring Joint Computer Conference in 1967. It is also known as Amdahl's argument. It is a formula that gives the theoretical speedup in latency of the execution of a task at a fixed workload that can be expected of a
6 min read
Computer Organization | Micro-Operation
In computer central processing units, micro-operations (also known as micro-ops) are the functional or atomic, operations of a processor. These are low level instructions used in some designs to implement complex machine instructions. They generally perform operations on data stored in one or more registers. They transfer data between registers or
3 min read
Computer Organization | Different Instruction Cycles
Introduction : Prerequisite - Execution, Stages and Throughput Registers Involved In Each Instruction Cycle: Memory address registers(MAR) : It is connected to the address lines of the system bus. It specifies the address in memory for a read or write operation.Memory Buffer Register(MBR) : It is connected to the data lines of the system bus. It co
11 min read
Computer Organization | Booth's Algorithm
Booth algorithm gives a procedure for multiplying binary integers in signed 2’s complement representation in efficient way, i.e., less number of additions/subtractions required. It operates on the fact that strings of 0’s in the multiplier require no addition but just shifting and a string of 1’s in the multiplier from bit weight 2^k to weight 2^m
7 min read
Purpose of an Interrupt in Computer Organization
Interrupt is the mechanism by which modules like I/O or memory may interrupt the normal processing by CPU. It may be either clicking a mouse, dragging a cursor, printing a document etc the case where interrupt is getting generated. Why we require Interrupt? External devices are comparatively slower than CPU. So if there is no interrupt CPU would wa
2 min read
Terminologies Cache Memory Organization
Cache Memory is a small, fast memory that holds a fraction of the overall contents of the memory. Its mathematical model is defined by its size, number of sets, associativity, block size, sub-block size, fetch strategy, and write strategy. Any node in the cache hierarchy can contain a common cache or two separate caches for instruction and or data.
4 min read
Control Logic Gates in Computer Organization
Control Logic Gates is the hardware component of a basic computer. It comprises some inputs and outputs. The diagram given below is related to the hardwired control organization. The diagram below consists of the instruction register which has three parts: the I bit (15), the operation code (12, 13, 14), and bits 0 through 11. The symbols as D0 to
2 min read
Register Organization in RISC CPU
RISC processors :They are processors that use a small instruction set and simple addressing mode so that their instructions can be executed much faster within the CPU with less referring to the memory. This type of processor is classified as a reduced instruction set computer( RISC). For detailed understanding of the RISC processor and its characte
5 min read
File Organization in DBMS | Set 2
Pre-Requisite: Hashing Data Structure In a database management system, When we want to retrieve a particular data, It becomes very inefficient to search all the index values and reach the desired data. In this situation, Hashing technique comes into the picture. Hashing is an efficient technique to directly search the location of desired data on th
6 min read
File Organization in DBMS | Set 3
B+ Tree, as the name suggests, uses a tree-like structure to store records in a File. It uses the concept of Key indexing where the primary key is used to sort the records. For each primary key, an index value is generated and mapped with the record. An index of a record is the address of the record in the file. B+ Tree is very similar to a binary
4 min read
Performance of Computer in Computer Organization
In computer organization, performance refers to the speed and efficiency at which a computer system can execute tasks and process data. A high-performing computer system is one that can perform tasks quickly and efficiently while minimizing the amount of time and resources required to complete these tasks. There are several factors that can impact
5 min read
File Organization in DBMS - Set 1
A database consists of a huge amount of data. The data is grouped within a table in RDBMS, and each table has related records. A user can see that the data is stored in the form of tables, but in actuality, this huge amount of data is stored in physical memory in the form of files. What is a File?A file is named a collection of related information
6 min read
Computer Organization & Architecture: GATE CSE Previous Year Questions
Solving GATE Previous Year's Questions (PYQs) not only clears the concepts but also helps to gain flexibility, speed, accuracy, and understanding of the level of questions generally asked in the GATE exam, and that eventually helps you to gain good marks in the examination. Previous Year Questions help a candidate practice and revise for GATE, whic
4 min read
Computer Organization | Hardwired v/s Micro-programmed Control Unit
Introduction : In computer architecture, the control unit is responsible for directing the flow of data and instructions within the CPU. There are two main approaches to implementing a control unit: hardwired and micro-programmed. A hardwired control unit is a control unit that uses a fixed set of logic gates and circuits to execute instructions. T
5 min read
RISC and CISC in Computer Organization
RISC is the way to make hardware simpler whereas CISC is the single instruction that handles multiple work. In this article, we are going to discuss RISC and CISC in detail as well as the Difference between RISC and CISC, Let's proceed with RISC first. Reduced Instruction Set Architecture (RISC)The main idea behind this is to simplify hardware by u
5 min read
Computer Organization | Instruction Formats (Zero, One, Two and Three Address Instruction)
In computer organization, instruction formats refer to the way instructions are encoded and represented in machine language. There are several types of instruction formats, including zero, one, two, and three-address instructions. Each type of instruction format has its own advantages and disadvantages in terms of code size, execution time, and fle
10 min read
Cache Memory in Computer Organization
Cache memory is a small, high-speed storage area in a computer. The cache is a smaller and faster memory that stores copies of the data from frequently used main memory locations. There are various independent caches in a CPU, which store instructions and data. The most important use of cache memory is that it is used to reduce the average time to
9 min read
Differences between Computer Architecture and Computer Organization
It is very important for any person who is interested or has a leaning towards computer science or anybody who has to work with computers to understand the difference between computer architecture and computer organization. What needs to be understood is that although these two concepts are interconnected they are different, one deals with the smal
5 min read
Difference between Memory and Storage
Memory: Memories are made up of registers. Memory refers to the location of short-term data. Each register in the memory is one storage location. Storage location is also called as memory location. Memory locations are identified using Address. The total number of bit a memory can store is its capacity. Memory is a vital component of a computer sys
4 min read
Storage Structure in Operating Systems
Basically we want the programs and data to reside in main memory permanently. This arrangement is usually not possible for the following two reasons: Main memory is usually too small to store all needed programs and data permanently. Main memory is a volatile storage device that loses its contents when power is turned off or otherwise lost. There a
2 min read
Storage Allocation Strategies in Compiler Design
A compiler is a program that converts HLL(High-Level Language) to LLL(Low-Level Language) like machine language. In a compiler, there is a need for storage allocation strategies in Compiler design because it is very important to use the right strategy for storage allocation as it can directly affect the performance of the software. Storage Allocati
5 min read
Difference between Turn Around Time (TAT) and Waiting Time (WT) in CPU Scheduling
In CPU Scheduling, we often need to find the average Turnaround and Waiting Time with the help of Arrival, Burst and Completion Time. Let's have a brief look of them: Turnaround Time (TAT): It is the time interval from the time of submission of a process to the time of the completion of the process.The difference b/w Completion Time and Arrival Tim
2 min read
Difference between Seek Time and Disk Access Time in Disk Scheduling
Seek Time: A disk is divided into many circular tracks. Seek Time is defined as the time required by the read/write head to move from one track to another. Example, Consider the following diagram, the read/write head is currently on track 1. Now, on the next read/write request, we may want to read data from Track 4, in this case, our read/write hea
3 min read
Difference between Transfer Time and Disk Access Time in Disk Scheduling
1. Transfer Time : Time required to transfer the required amount of data. It can be calculated by the given formula Transfer time, = Data to be transfer / transfer rate Data to be transfer is given in the question and transfer rate is sometimes given and sometimes it may not be given. It can be calculated by the given formula. Transfer Rate, = {(Nu
2 min read
Difference between Hard real time and Soft real time system
Real time system is defined as a system in which job has deadline, job has to finished by the deadline (strictly finished). If a result is delayed, huge loss may happen. A real-time operating system (RTOS) is a type of operating system that is designed to meet strict time constraints, with a guaranteed response time for critical tasks. An example o
3 min read
Difference between Arrival Time and Burst Time in CPU Scheduling
CPU scheduling algorithms require CPU time and IO time required for its execution. CPU time is time taken by CPU to carry out the process while I/O time illustrates the time required for I/O operation by the process. The execution of multiple processes in an optimised way is based on different kinds of algorithms, like FCFS, Shortest Job First etc.
3 min read
Difference between Compile Time and Execution Time address binding
Prerequisite - Address Binding Methods Address Binding is the association of program instructions and data to the actual physical memory location. There are various types of address binding in the operating system. There are 3 types of Address Binding: Compile Time Address Binding Load Time Address Binding Execution Time Address Binding Here, we co
2 min read
Difference Between Seek Time and Transfer Time in Disk Scheduling
The head's seek time is the time it takes to move from the current track to the one containing the data. The amount of time needed to move data from the disc to the host system is called the transfer time. In hard drives, a head is present which is supposed to write or read from the magnetic disk. In this article we are going to discuss what are se
4 min read
Difference between Compile Time and Load Time address Binding
Prerequisite - Address Binding Methods Address Binding is the association of program instructions and data to the actual physical memory location. There are various types of address binding in the operating system. There are 3 types of Address Binding: Compile Time Address Binding Load Time Address Binding Execution Time Address Binding Here, we co
2 min read
Difference between Load Time and Execution Time address binding
Prerequisite - Address Binding Methods Address Binding is the association of program instructions and data to the actual physical memory location. There are various types of address binding in the operating system. There are 3 types of Address Binding: Compile Time Address Binding Load Time Address Binding Execution Time Address Binding Here, we co
2 min read
Article Tags :