The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+14 votes
1.3k views

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

asked in Operating System by Veteran (59.6k points) | 1.3k views
0
Address space is the amount of memory allocated for all possible addresses for a computational entity, such as a device, a file, a server, or a networked computer. Address space may refer to a range of either physical or virtual addresses accessible to a processor or reserved for a process.So in this option b how can we say that it refers to logical [email protected] sir pls help
0

@Habibkhan Why statement B and C are false?

What do you mean by address space of a computer?  If it's physical address space of a computer then statement B and C are also true?

+10
Address space by default means logical address space..
+1

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

Program longer than it's logical address space doesn't make any sense. So it is false.

Option C says Virtual memory can be used to accommodate a program which is longer than the address space of a computer.  It is also false because of above reason.

Have I done correct reasoning?

+1
@shivam
Overlay is used when virtual memory is absent. But question is indirectly asked if it work in requirement of virtual memory
But concept of overlay totally different than virtual memory

3 Answers

+19 votes
Best answer
  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
answered by Veteran (363k points)
edited by
0

@Ayush. I have seen the link you shared.On slide 17/51 there is a nested macro topic.But they say

nested macro (a macro invoked by another macro).

But we in context to question are talking about definition of a macro in a macro and not Marco calling other macro

0
@rahul, what about a system who does not have a MMU.In that case our address space would be physical only right.?
0
Have you seen the second link rahul?the ibm one?
0

No.I will see once i get time.I searched on google and the first document i get has the line:-

A macro definition can appear anywhere in an assembly language program before the END directive; however for MASM and TASM the definition of a macro must appear before a call to that macro and a macro definition cannot appear inside another macro definition. It is usual to place all macro definitions at the beginning of a program before the segment definitions.

0
Overlays are made when there is a need of running a program of larger size than the memory allocated to it. A program is broken into overlays say overlay1 and overlay2, now overlay1 is loaded into main memory and overlay2 is still in secondary memory. When overlay1 finishes its execution, it gets overwritten by overlay2 and it gets executed without loading whole program at a time. Swapping in a scheme in which pages from main memory to secondary memory are being swapped in(rolled in) and swapped out(rolled out) as desired during execution of a
+1

Regarding A) http://plit.de/asem-51/nestdefs.htm

says "

A macro body may also contain further macro definitions. However, these nested macro definitions aren't valid until the enclosing macro has been expanded! That means, the enclosing macro must have been called, before the nested macros can be called. "

0
@pCS-so what is your opinion regarding A?

Should it be marked true?
0

I think yes & regarding what was quoted by rahul sharma 5 "A macro definition can appear anywhere in an assembly language program before the END directive; however for MASM and TASM the definition of a macro must appear before a call to that macro and a macro definition cannot appear inside another macro definition. It is usual to place all macro definitions at the beginning of a program before the segment definitions.",

it is specifically for MASM, TASM.

0
@Arjun @Arjuncorrect this answer according to aayush's comment
0
I would have done if it was needed.
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

answered by (259 points)
–2 votes
option c is correct as virtual memory provides virtual address which can be directly converted to physical address.
answered by (53 points)
0
I think A and B both are true.

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

42,613 questions
48,608 answers
155,798 comments
63,788 users