• recategorized by
15,686 views
35 35 votes

Which one of the following statements is true?

  1. Macro definitions cannot appear within other macro definitions in assembly language programs

  2. Overlaying is used to run a program which is longer than the address space of a computer

  3. Virtual memory can be used to accommodate a program which is longer than the address space of a computer

  4. It is not possible to write interrupt service routines in a high level language

5 Answers

Best answer
34 34 votes
  1. Is TRUE.
  2. False. Overlaying is used to increase the address space usage when physical memory is limited on systems where virtual memory is absent. But it cannot increase the address space (logical) of a computer. 
  3. False. Like above is true for physical memory but here it is specified address space which should mean logical address space. 
  4. Is false. We can write in high level language just that the performance will be bad. 
• edited by
1 1 vote
Option A

Macros are expanded during the preprocessing stage.
A macro can be used inside macro defination,given that particular macro is defined before.
But defining a marco inside an another macro will lead to nesting issuses causing unpredicitible behaviour.

for example:

#define OUTER_MACRO(x) do
  int temp;                     // This line would be inside the outer macro
  #define INNER_MACRO(y) y * y  // Attempting to define a macro here
  temp = INNER_MACRO(x);        // This line would also be inside the outer macro
  printf("Result: %d\n", temp);
} while (0)

int main() {
  OUTER_MACRO(5);
  return 0;
}

The INNER_MACRO definition would be encountered during preprocessing while expanding the OUTER_MACRO.

Depending on the compiler, this might lead to an error, unexpected expansion, or incomplete processing
hence,A True.

For next two options:
The address space refers to the set of all valid memory addresses,not necessarily the physical amount of RAM available.

Option B

Overlaying is a memory management technique used to run programs that are larger than the available physical memory (RAM).
Overlaying can't be used to increase the address space(logical) of a computer.
hence,B False.

Option C

we can't accomodate a program that is can't be greater then the address space(logical) of a computer.
hence,C False.

Option D

Interrupt service routines (ISRs) can be written in both high-level languages (HLLs) and assembly language, but there are trade-offs.
hence,D False.
0 0 votes

Both B and C are true

B says overlay is used to

long program which is correct don’t confuse with address space here please

C says virtual memory is used to accomodate  long program which is correct

0 0 votes

The correct option is A. Macro definitions cannot appear within other macro definitions in assembly language programs.


NOTE: Overlay VS Virtual Memory 

 

 

Answer:
Position:
Show:

Related questions

59 59 votes
4 answers 4 answers
32.3k
32.3k views
Kathleen asked Oct 5, 2014
32,345 views
Consider the following recursive function:function fib (n:integer);integer; begin if (n=0) or (n=1) then fib := 1 else fib := fib(n-1) + fib(n-2) end;The above function i...
41 41 votes
4 answers 4 answers
19.0k
19.0k views
Kathleen asked Oct 4, 2014
18,955 views
Consider the following heap (figure) in which blank regions are not in use and hatched region are in use.The sequence of requests for blocks of sizes $300, 25, 125, 50$ c...
40 40 votes
4 answers 4 answers
28.5k
28.5k views
Kathleen asked Oct 5, 2014
28,494 views
Consider the resource allocation graph in the figure.Find if the system is in a deadlock stateOtherwise, find a safe sequence
21 21 votes
3 answers 3 answers
10.5k
10.5k views
Kathleen asked Oct 5, 2014
10,530 views
Draw a precedence graph for the following sequential code. The statements are numbered from $S_1$ to $S_6$$S_1$read n$S_2$i := 1$S_3$if i n next$S_4$a(i) := i+1$S_5$i :=...