The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+16 votes
1.7k 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

in Operating System by Veteran (52.1k points)
edited by | 1.7k 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?

+11
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
by Veteran (416k points)
edited by
0
c is false ?? how sir ??
0
i think c is true
+1
Sir, in option B: "address space of a computer" means what ? -   virtual or physical ?

I think it should be Physical.  program is  longer than logical address space does not make sense.
Is it ?  Because generally logical address space is quite big compare to program size.
0
@Sachin address space of program means Physical Address.

Program is larger than Physical or Logical Address do't make any sense.
0

@Sachin , then option C) should also be true.

What is meant by address space of a computer?

+3

@Arjun Sir,

I am not convinced by your answer, sir!

(1) Nested macro definitions are allowed in assembly language.

https://www.csie.ntu.edu.tw/~acpang/course/asm_2004/.../chapt_10_PartIIbw.pdf

https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.asma400/nestmac.htm

(2) The overlay is used to execute programs which are larger than the physical memory of the system as this was developed as a shortcoming to fixed partitioning method where the process size was limited by the size of the partition.

Reference: http://www.geeksforgeeks.org/operating-system-overlays-memory-management/

Now, here in option it is mentioned "address space"

the address space of the computer can be either physical or logical

Reference: http://searchstorage.techtarget.com/definition/address-space

So, this option might be true.

(3) Similar reason, this might also be true.

(4)No, we can write ISR in high-level language but the performance will be bad.

Reference: https://barrgroup.com/embedded-systems/how-to/interrupt-service-routines

So, I think (B) and (C) should be true.

Let me know sir, If I am correct.

0
Here i think address space of computer means secoudary memory so overlaying can't run a program larger than secoundary memoryand similar with virtual memory
0
Then which option should be correct?
0
A is answer
0
But nested macro definitions are allowed
0
In that case iam not able to figure out which one is true
+1
Then use google, find out and help us :)
0

@Ayush Upadhyaya 

As you yourself say,that address space can be physical or logical.So,in that case this statement will not hold always for making b and c as true/?

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
+2

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
+2
I would have done if it was needed.
0

I went through the answers/comments in this thread and came to a conclusion that: address space of a computer refers to the "logical" address space.

This, in fact, confused me to an extent to ask this: what exactly is meant by the logical space, and how does it differ from the physical address space?

Note: My understanding of the physical address space is the set of all memory addresses (main memory, to be precise) present in a computer system.

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

by (253 points)
–2 votes
option c is correct as virtual memory provides virtual address which can be directly converted to physical address.
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
49,841 questions
54,799 answers
189,484 comments
80,657 users