Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between physical and absolute address?

Tags:

memory

x86

They seem both explicitly to specify real memory location. What is the difference between physical and absolute address?

like image 969
scdmb Avatar asked Jul 05 '12 17:07

scdmb


1 Answers

Physical Address (a.k.a. the real deal):

A physical address is the address used by the bus circuitry (hence 'physical') when transferring data to and from RAM.

Its counterpart is a 'virtual address' i.e. in a computer with virtual memory, virtual addresses are used by applications, and are translated to physical addresses when actually accessing RAM. The applications only see virtual addresses. This means that all memory references in application code refer to virtual addresses.

Absolute Address:

Absolute address is actually a term used when referring to one of the addressing modes used by an application. Thus, in a computer that offers virtual memory, this 'absolute address' is also a virtual address - because all application code is only going to refer to virtual addresses. Other addressing modes use virtual addresses as well. Of course, like I wrote earlier, virtual addresses are eventually mapped to a physical addresses when accessing RAM.

Here is how an 'absolute address' is different from it's counterparts - the other addressing modes (one of them being 'relative address'):

An Intel JMP(jump) instruction may specify a 'relative jump', where the displacement is relative to the next instruction. Something like:

"Jump N bytes ahead of the next instruction" <- This is PC-relative addressing.

Or it may be used with an absolute address, like:

"Jump to the Nth byte in memory" <- This is absolute addressing.

In both cases, the addresses being referred to by the JMPs are virtual addresses (which get mapped to a physical address in a way that is transparent to the application)

like image 177
ArjunShankar Avatar answered Nov 15 '22 09:11

ArjunShankar