recategorized by
8,538 views
27 votes
27 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

recategorized by

4 Answers

Best answer
28 votes
28 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
0 votes
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 votes
0 votes
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.
–2 votes
–2 votes
option c is correct as virtual memory provides virtual address which can be directly converted to physical address.
Answer:

Related questions

34 votes
34 votes
4 answers
3
Kathleen asked Oct 5, 2014
19,987 views
Consider the resource allocation graph in the figure.Find if the system is in a deadlock stateOtherwise, find a safe sequence