|
-
October 29th, 2012, 01:20 AM
#2
Re: What is meant by "Compiler allocates memory for an array"
 Originally Posted by AwArEnEsS
But when I run the executable file and if that memory address(189) is not free,what happens?
Most addresses in a program are relative to something (the most common exception is addresses to hardware units which are at fixed locations).
In your example 189 would not be an absolute address but rather an offset from some base register. This base register would be set to a defined address when the program is started, say the address of the start position of the program. In this way it doesn't matter where the program is loaded into memory. It's relocatable.
Last edited by nuzzle; October 31st, 2012 at 12:16 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|