Question

A) Does subroutine know whether it will be part of a nested subroutine call or not...

A) Does subroutine know whether it will be part of a nested subroutine call or not ?

Homework Answers

Answer #1

Subroutine nesting is a programming practice In which one subroutine call another subroutine. A subroutine does not know if its a part of another subroutine. The link register holds the return address of the currently calling subroutine. This is done using the stack data structure when nested calls are involved. So, when a nested call is made to a subroutine, its address is added to the stack data structure. This is how stack memory works.

The diagram below shows this representation. The subroutine does not know whether it will be a part of a nested subroutine call or not since only one subroutine is being processed at a time, which is managed by the stack memory.

  

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Q1 ) We are writing a subroutine, and want to use $t0. What are the considerations?...
Q1 ) We are writing a subroutine, and want to use $t0. What are the considerations? (check all that apply) 1 - We know that the routine which called us gives us permission to use this register, so we don't have to save its value before using it. 2 - The routine which called us may have an important value in that register, so we should save its value before using it. 3- We know that the subroutine won't touch...
where does the fetch part of the cycle get its instruction from? how does it know...
where does the fetch part of the cycle get its instruction from? how does it know exactly ehere to go? explain your answer in deatil
Does the non-archimedean field R(t) satisfy the Nested Interval Property? Explain. Note that R(t) elements are...
Does the non-archimedean field R(t) satisfy the Nested Interval Property? Explain. Note that R(t) elements are rational functions in the variable t with coefficients in R. We take the ratio of polynomials to create the elements.
Tell whether the following call for a right-tailed, left-tailed, or two-tailed alternative hypothesis: A worker is...
Tell whether the following call for a right-tailed, left-tailed, or two-tailed alternative hypothesis: A worker is testing whether the strength of a bolt exceeds the industry requirements. A chef wants to know whether there is a change of opinion on his food after making some minor adjustments to the recipes. A state official wants to test whether the changes of winning a lottery are less than advertised. 4. A chemist believes a new compound he’s discovered will speed up certain...
Call feature? Who does a call feature benefit Please answer it in bond area
Call feature? Who does a call feature benefit Please answer it in bond area
Suppose that we want to know the mean income of residents in Brazos County. Call this...
Suppose that we want to know the mean income of residents in Brazos County. Call this mean income μY. We cannot afford to survey every person in Brazos County, so we decide to randomly select 100 people and ask their income. This yields a sample of 100 random variables {Y1, Y2, ..., Y100}. You suggest taking the sample average of all 100 observations as your estimate of ^μY . Your statistics friend suggests taking the 37th observation (Y37) as his...
does the current flow in the same direction for the charging and discharging part? ( how...
does the current flow in the same direction for the charging and discharging part? ( how do you know) why are they in the same/opposite direction? thank you
Discuss whether or not differentiating between a conversion and call is necessary for how we interpret...
Discuss whether or not differentiating between a conversion and call is necessary for how we interpret Paul’s letters in the bible?
A company introduced a new product into the market and is interested to know whether it...
A company introduced a new product into the market and is interested to know whether it has some market (monopoly) power. You are assigned to determine whether the company has a market power in the industry. You reviewed the available information about the company and you have learned that the company produces a somewhat unique product that sells for $12 per unit, and the marginal cost is $7.00. Does the company have a market power? Why? Explain to the manager...
Class work # 12 / Chapter 6 –> Arrays 3 (two dimensional arrays) Part 1: Create...
Class work # 12 / Chapter 6 –> Arrays 3 (two dimensional arrays) Part 1: Create a 2-by-3 integer array and initialize it with 6 integers of your choice. Using nested for loops, display the contents of the array on the screen Part 2: (Continue on part 1) Display the sum of all the integers in the array that you created in part 1. Create a function Part 3: Create a function that will display the elements of the array...