Replies
Welcome, guest
Join CrazyEngineers to reply, ask questions, and participate in conversations.
CrazyEngineers powered by Jatra Community Platform
-
@abrakadabra • Jun 5, 2012
#-Link-Snipped-#
First of all, yes! A memory address can be absolute or relative.
An absolute address is a fixed address in memory. Whereas a relative address indicates a location by specifying a distance from another location.
Absolute addresses are also called real addresses or machine addresses.
I think this diagram will be helpful -

-
@kenjackson-mBf7HF • Jun 6, 2012
It's not clear what you're asking. What context? Are you writing a graphical app (mouse, pull-down menus, etc.) on a big popular OS like Windows or Linux? Or are you writing an embedded program like a program in a microcontroller that controls an elevator's lights?
In my embedded world, we often know exactly the maximum RAM address, so we can test any pointer to make sure it's pointing to RAM and not into no-man's land. But programs running on Windows, Linux or Mac don't know what address they will be loaded at ahead of time.
And on top of that, big OSes all use virtual memory mapping, so they can load your program at one physical address while it sees a different virtual address. In fact, if memory is fragmented, the program can be loaded into different pages all over the physical address space, but the program will see them all in sequence.