<s>
In	O
computing	O
,	O
a	O
memory	B-General_Concept
address	I-General_Concept
is	O
a	O
reference	O
to	O
a	O
specific	O
memory	B-General_Concept
location	I-General_Concept
used	O
at	O
various	O
levels	O
by	O
software	O
and	O
hardware	B-Architecture
.	O
</s>
<s>
Memory	B-General_Concept
addresses	O
are	O
fixed-length	O
sequences	O
of	O
digits	O
conventionally	O
displayed	O
and	O
manipulated	O
as	O
unsigned	B-Algorithm
integers	I-Algorithm
.	O
</s>
<s>
Such	O
numerical	O
semantic	O
bases	O
itself	O
upon	O
features	O
of	O
CPU	O
(	O
such	O
as	O
the	O
instruction	B-General_Concept
pointer	I-General_Concept
and	O
incremental	O
address	B-General_Concept
registers	I-General_Concept
)	O
,	O
as	O
well	O
upon	O
use	O
of	O
the	O
memory	B-General_Concept
like	O
an	O
array	B-Data_Structure
endorsed	O
by	O
various	O
programming	O
languages	O
.	O
</s>
<s>
A	O
digital	O
computer	O
's	O
main	O
memory	B-General_Concept
consists	O
of	O
many	O
memory	B-General_Concept
locations	I-General_Concept
.	O
</s>
<s>
Each	O
memory	B-General_Concept
location	I-General_Concept
has	O
a	O
physical	B-General_Concept
address	I-General_Concept
which	O
is	O
a	O
code	O
.	O
</s>
<s>
The	O
CPU	O
(	O
or	O
other	O
device	O
)	O
can	O
use	O
the	O
code	O
to	O
access	O
the	O
corresponding	O
memory	B-General_Concept
location	I-General_Concept
.	O
</s>
<s>
Generally	O
only	O
system	B-Application
software	I-Application
,	O
i.e.	O
</s>
<s>
the	O
BIOS	B-Operating_System
,	O
operating	B-General_Concept
systems	I-General_Concept
,	O
and	O
some	O
specialized	O
utility	B-Application
programs	I-Application
(	O
e.g.	O
,	O
memory	B-Application
testers	I-Application
)	O
,	O
address	B-Architecture
physical	O
memory	B-General_Concept
using	O
machine	B-Language
code	I-Language
operands	O
or	O
processor	B-General_Concept
registers	I-General_Concept
,	O
instructing	O
the	O
CPU	O
to	O
direct	O
a	O
hardware	B-Architecture
device	O
,	O
called	O
the	O
memory	B-General_Concept
controller	I-General_Concept
,	O
to	O
use	O
the	O
memory	B-General_Concept
bus	B-General_Concept
or	O
system	B-Architecture
bus	I-Architecture
,	O
or	O
separate	O
control	B-Architecture
,	O
address	B-Architecture
and	O
data	B-General_Concept
busses	I-General_Concept
,	O
to	O
execute	O
the	O
program	O
's	O
commands	O
.	O
</s>
<s>
The	O
memory	B-General_Concept
controllers	I-General_Concept
 '	O
bus	B-General_Concept
consists	O
of	O
a	O
number	O
of	O
parallel	O
lines	O
,	O
each	O
represented	O
by	O
a	O
binary	O
digit	O
(	O
bit	O
)	O
.	O
</s>
<s>
The	O
width	O
of	O
the	O
bus	B-General_Concept
,	O
and	O
thus	O
the	O
number	O
of	O
addressable	O
storage	O
units	O
,	O
and	O
the	O
number	O
of	O
bits	O
in	O
each	O
unit	O
,	O
varies	O
among	O
computers	O
.	O
</s>
<s>
A	O
computer	B-Application
program	I-Application
uses	O
memory	B-General_Concept
addresses	O
to	O
execute	O
machine	B-Language
code	I-Language
,	O
and	O
to	O
store	O
and	O
retrieve	O
data	B-General_Concept
.	O
</s>
<s>
In	O
early	O
computers	O
logical	O
and	O
physical	O
addresses	O
corresponded	O
,	O
but	O
since	O
the	O
introduction	O
of	O
virtual	B-Architecture
memory	I-Architecture
most	O
application	B-Application
programs	I-Application
do	O
not	O
have	O
a	O
knowledge	O
of	O
physical	O
addresses	O
.	O
</s>
<s>
Rather	O
,	O
they	O
address	B-Architecture
logical	O
addresses	O
,	O
or	O
virtual	B-General_Concept
addresses	I-General_Concept
,	O
using	O
the	O
computer	O
's	O
memory	B-General_Concept
management	I-General_Concept
unit	I-General_Concept
and	O
operating	B-General_Concept
system	I-General_Concept
memory	B-General_Concept
mapping	O
;	O
see	O
below	O
.	O
</s>
<s>
Most	O
modern	O
computers	O
are	O
byte-addressable	B-General_Concept
.	O
</s>
<s>
Each	O
address	B-Architecture
identifies	O
a	O
single	O
byte	B-Application
(	O
eight	O
bits	O
)	O
of	O
storage	O
.	O
</s>
<s>
Data	B-General_Concept
larger	O
than	O
a	O
single	O
byte	B-Application
may	O
be	O
stored	O
in	O
a	O
sequence	O
of	O
consecutive	O
addresses	O
.	O
</s>
<s>
There	O
exist	O
word-addressable	B-General_Concept
computers	O
,	O
where	O
the	O
minimal	O
addressable	O
storage	O
unit	O
is	O
exactly	O
the	O
processor	O
's	O
word	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
Data	B-Device
General	I-Device
Nova	I-Device
minicomputer	B-Architecture
,	O
and	O
the	O
Texas	B-General_Concept
Instruments	I-General_Concept
TMS9900	I-General_Concept
and	O
National	B-Device
Semiconductor	I-Device
IMP-16	I-Device
microcomputers	B-Architecture
used	O
16	O
bit	O
words	O
,	O
and	O
there	O
were	O
many	O
36-bit	O
mainframe	B-Architecture
computers	I-Architecture
(	O
e.g.	O
,	O
PDP-10	B-Device
)	O
which	O
used	O
18-bit	O
word	B-General_Concept
addressing	I-General_Concept
,	O
not	O
byte	B-General_Concept
addressing	I-General_Concept
,	O
giving	O
an	O
address	B-Architecture
space	O
of	O
218	O
36-bit	O
words	O
,	O
approximately	O
1	O
megabyte	O
of	O
storage	O
.	O
</s>
<s>
The	O
efficiency	O
of	O
addressing	O
of	O
memory	B-General_Concept
depends	O
on	O
the	O
bit	O
size	O
of	O
the	O
bus	B-General_Concept
used	O
for	O
addresses	O
–	O
the	O
more	O
bits	O
used	O
,	O
the	O
more	O
addresses	O
are	O
available	O
to	O
the	O
computer	O
.	O
</s>
<s>
For	O
example	O
,	O
an	O
8-bit-byte-addressable	O
machine	O
with	O
a	O
20-bit	O
address	B-Architecture
bus	I-Architecture
(	O
e.g.	O
</s>
<s>
Intel	B-General_Concept
8086	I-General_Concept
)	O
can	O
address	B-Architecture
220	O
(	O
1,048,576	O
)	O
memory	B-General_Concept
locations	I-General_Concept
,	O
or	O
one	O
MiB	O
of	O
memory	B-General_Concept
,	O
while	O
a	O
32-bit	O
bus	B-General_Concept
(	O
e.g.	O
</s>
<s>
Intel	B-General_Concept
80386	I-General_Concept
)	O
addresses	O
232	O
(	O
4,294,967,296	O
)	O
locations	O
,	O
or	O
a	O
4	O
GiB	O
address	B-Architecture
space	O
.	O
</s>
<s>
In	O
contrast	O
,	O
a	O
36-bit	O
word-addressable	B-General_Concept
machine	O
with	O
an	O
18-bit	O
address	B-Architecture
bus	I-Architecture
addresses	O
only	O
218	O
(	O
262,144	O
)	O
36-bit	O
locations	O
(	O
9,437,184	O
bits	O
)	O
,	O
equivalent	O
to	O
1,179,648	O
8-bit	O
bytes	B-Application
,	O
or	O
1152	O
KiB	O
,	O
or	O
1.125	O
MiB	O
—	O
slightly	O
more	O
than	O
the	O
8086	B-General_Concept
.	O
</s>
<s>
Some	O
older	O
computers	O
(	O
decimal	B-Device
computers	I-Device
)	O
,	O
were	O
decimal	B-Application
digit-addressable	O
.	O
</s>
<s>
For	O
example	O
,	O
each	O
address	B-Architecture
in	O
the	O
IBM	B-Device
1620	I-Device
's	O
magnetic-core	O
memory	B-General_Concept
identified	O
a	O
single	O
six	O
bit	O
binary-coded	O
decimal	B-Application
digit	O
,	O
consisting	O
of	O
a	O
parity	B-Error_Name
bit	I-Error_Name
,	O
flag	O
bit	O
and	O
four	O
numerical	O
bits	O
.	O
</s>
<s>
The	O
1620	O
used	O
5-digit	O
decimal	B-Application
addresses	O
,	O
so	O
in	O
theory	O
the	O
highest	O
possible	O
address	B-Architecture
was	O
99,999	O
.	O
</s>
<s>
In	O
practice	O
,	O
the	O
CPU	O
supported	O
20,000	O
memory	B-General_Concept
locations	I-General_Concept
,	O
and	O
up	O
to	O
two	O
optional	O
external	O
memory	B-General_Concept
units	O
could	O
be	O
added	O
,	O
each	O
supporting	O
20,000	O
addresses	O
,	O
for	O
a	O
total	O
of	O
60,000	O
(	O
00000	O
–	O
59999	O
)	O
.	O
</s>
<s>
Word	O
size	O
is	O
a	O
characteristic	O
of	O
computer	B-General_Concept
architecture	I-General_Concept
denoting	O
the	O
number	O
of	O
bits	O
that	O
a	O
CPU	O
can	O
process	B-Operating_System
at	O
one	O
time	O
.	O
</s>
<s>
Modern	O
processors	O
,	O
including	O
embedded	B-Architecture
systems	I-Architecture
,	O
usually	O
have	O
a	O
word	O
size	O
of	O
8	O
,	O
16	O
,	O
24	O
,	O
32	O
or	O
64	B-Device
bits	I-Device
;	O
most	O
current	O
general-purpose	O
computers	O
use	O
32	O
or	O
64	B-Device
bits	I-Device
.	O
</s>
<s>
Very	O
often	O
,	O
when	O
referring	O
to	O
the	O
word	O
size	O
of	O
a	O
modern	O
computer	O
,	O
one	O
is	O
also	O
describing	O
the	O
size	O
of	O
address	B-Architecture
space	O
on	O
that	O
computer	O
.	O
</s>
<s>
For	O
instance	O
,	O
a	O
computer	O
said	O
to	O
be	O
"	O
32-bit	O
"	O
also	O
usually	O
allows	O
32-bit	O
memory	B-General_Concept
addresses	O
;	O
a	O
byte-addressable	B-General_Concept
32-bit	O
computer	O
can	O
address	B-Architecture
232	O
=	O
4,294,967,296	O
bytes	B-Application
of	O
memory	B-General_Concept
,	O
or	O
4	O
gibibytes	O
(	O
GiB	O
)	O
.	O
</s>
<s>
This	O
allows	O
one	O
memory	B-General_Concept
address	I-General_Concept
to	O
be	O
efficiently	O
stored	O
in	O
one	O
word	O
.	O
</s>
<s>
Computers	O
can	O
have	O
memory	B-General_Concept
addresses	O
larger	O
or	O
smaller	O
than	O
their	O
word	O
size	O
.	O
</s>
<s>
For	O
instance	O
,	O
many	O
8-bit	O
processors	O
,	O
such	O
as	O
the	O
MOS	B-General_Concept
Technology	I-General_Concept
6502	I-General_Concept
,	O
supported	O
16-bit	O
addresses	O
—	O
if	O
not	O
,	O
they	O
would	O
have	O
been	O
limited	O
to	O
a	O
mere	O
256	O
bytes	B-Application
of	O
memory	B-General_Concept
addressing	I-General_Concept
.	O
</s>
<s>
The	O
16-bit	O
Intel	B-Device
8088	I-Device
and	O
Intel	B-General_Concept
8086	I-General_Concept
supported	O
20-bit	O
addressing	O
via	O
segmentation	B-General_Concept
,	O
allowing	O
them	O
to	O
access	O
1	O
MiB	O
rather	O
than	O
64	O
KiB	O
of	O
memory	B-General_Concept
.	O
</s>
<s>
All	O
Intel	B-Device
Pentium	I-Device
processors	I-Device
since	O
the	O
Pentium	B-Device
Pro	I-Device
include	O
Physical	B-General_Concept
Address	I-General_Concept
Extensions	I-General_Concept
(	O
PAE	O
)	O
which	O
support	O
mapping	O
36-bit	O
physical	O
addresses	O
to	O
32-bit	O
virtual	B-General_Concept
addresses	I-General_Concept
.	O
</s>
<s>
In	O
theory	O
,	O
modern	O
byte-addressable	B-General_Concept
64-bit	B-Device
computers	I-Device
can	O
address	B-Architecture
264	O
bytes	B-Application
(	O
16	O
exbibytes	O
)	O
,	O
but	O
in	O
practice	O
the	O
amount	O
of	O
memory	B-General_Concept
is	O
limited	O
by	O
the	O
CPU	O
,	O
the	O
memory	B-General_Concept
controller	I-General_Concept
,	O
or	O
the	O
printed	O
circuit	O
board	O
design	O
(	O
e.g.	O
,	O
number	O
of	O
physical	O
memory	B-General_Concept
connectors	O
or	O
amount	O
of	O
soldered-on	O
memory	B-General_Concept
)	O
.	O
</s>
<s>
Each	O
memory	B-General_Concept
location	I-General_Concept
in	O
a	O
stored-program	O
computer	O
holds	O
a	O
binary	O
number	O
or	O
decimal	B-Application
number	O
of	O
some	O
sort	O
.	O
</s>
<s>
Its	O
interpretation	O
,	O
as	O
data	B-General_Concept
of	O
some	O
data	B-General_Concept
type	O
or	O
as	O
an	O
instruction	O
,	O
and	O
use	O
are	O
determined	O
by	O
the	O
instructions	O
which	O
retrieve	O
and	O
manipulate	O
it	O
.	O
</s>
<s>
Some	O
early	O
programmers	O
combined	O
instructions	O
and	O
data	B-General_Concept
in	O
words	O
as	O
a	O
way	O
to	O
save	O
memory	B-General_Concept
,	O
when	O
it	O
was	O
expensive	O
:	O
The	O
Manchester	B-Device
Mark	I-Device
1	I-Device
had	O
space	O
in	O
its	O
40-bit	O
words	O
to	O
store	O
little	O
bits	O
of	O
data	B-General_Concept
–	O
its	O
processor	O
ignored	O
a	O
small	O
section	O
in	O
the	O
middle	O
of	O
a	O
word	O
–	O
and	O
that	O
was	O
often	O
exploited	O
as	O
extra	O
data	B-General_Concept
storage	O
.	O
</s>
<s>
Self-replicating	O
programs	O
such	O
as	O
viruses	O
treat	O
themselves	O
sometimes	O
as	O
data	B-General_Concept
and	O
sometimes	O
as	O
instructions	O
.	O
</s>
<s>
Self-modifying	B-Application
code	I-Application
is	O
generally	O
deprecated	B-General_Concept
nowadays	O
,	O
as	O
it	O
makes	O
testing	O
and	O
maintenance	O
disproportionally	O
difficult	O
to	O
the	O
saving	O
of	O
a	O
few	O
bytes	B-Application
,	O
and	O
can	O
also	O
give	O
incorrect	O
results	O
because	O
of	O
the	O
compiler	O
or	O
processor	O
's	O
assumptions	O
about	O
the	O
machine	O
's	O
state	B-Application
,	O
but	O
is	O
still	O
sometimes	O
used	O
deliberately	O
,	O
with	O
great	O
care	O
.	O
</s>
<s>
In	O
modern	O
multitasking	B-Operating_System
environment	O
,	O
an	O
application	B-Application
process	B-Operating_System
usually	O
has	O
in	O
its	O
address	B-Architecture
space	O
(	O
or	O
spaces	O
)	O
chunks	O
of	O
memory	B-General_Concept
of	O
following	O
types	O
:	O
</s>
<s>
Machine	B-Language
code	I-Language
,	O
including	O
:	O
</s>
<s>
program	O
's	O
own	O
code	O
(	O
historically	O
known	O
as	O
code	B-General_Concept
segment	I-General_Concept
or	O
text	B-General_Concept
segment	I-General_Concept
)	O
;	O
</s>
<s>
Data	B-General_Concept
,	O
including	O
:	O
</s>
<s>
initialized	O
data	B-General_Concept
(	O
data	B-General_Concept
segment	I-General_Concept
)	O
;	O
</s>
<s>
run-time	B-General_Concept
stack	I-General_Concept
;	O
</s>
<s>
shared	B-Operating_System
memory	I-Operating_System
and	O
memory	B-General_Concept
mapped	I-General_Concept
files	I-General_Concept
.	O
</s>
<s>
Some	O
parts	O
of	O
address	B-Architecture
space	O
may	O
be	O
not	O
mapped	O
at	O
all	O
.	O
</s>
<s>
Some	O
systems	O
have	O
a	O
"	O
split	O
"	O
memory	B-General_Concept
architecture	I-General_Concept
where	O
machine	B-Language
code	I-Language
,	O
constants	O
,	O
and	O
data	B-General_Concept
are	O
in	O
different	O
locations	O
,	O
and	O
may	O
have	O
different	O
address	B-Architecture
sizes	O
.	O
</s>
<s>
For	O
example	O
,	O
PIC18	O
microcontrollers	O
have	O
a	O
21-bit	O
program	B-General_Concept
counter	I-General_Concept
to	O
address	B-Architecture
machine	B-Language
code	I-Language
and	O
constants	O
in	O
Flash	O
memory	B-General_Concept
,	O
and	O
12-bit	O
address	B-General_Concept
registers	I-General_Concept
to	O
address	B-Architecture
data	B-General_Concept
in	O
SRAM	O
.	O
</s>
<s>
A	O
computer	B-Application
program	I-Application
can	O
access	O
an	O
address	B-Architecture
given	O
explicitly	O
–	O
in	O
low-level	B-Language
programming	I-Language
this	O
is	O
usually	O
called	O
an	O
,	O
or	O
sometimes	O
a	O
specific	O
address	B-Architecture
,	O
and	O
is	O
known	O
as	O
pointer	O
data	B-General_Concept
type	O
in	O
higher-level	O
languages	O
.	O
</s>
<s>
But	O
a	O
program	O
can	O
also	O
use	O
relative	B-General_Concept
address	I-General_Concept
which	O
specifies	O
a	O
location	O
in	O
relation	O
to	O
somewhere	O
else	O
(	O
the	O
base	B-General_Concept
address	I-General_Concept
)	O
.	O
</s>
<s>
There	O
are	O
many	O
more	O
indirect	B-Language
addressing	I-Language
modes	O
.	O
</s>
<s>
Mapping	O
logical	O
addresses	O
to	O
physical	O
and	O
virtual	B-Architecture
memory	I-Architecture
also	O
adds	O
several	O
levels	O
of	O
indirection	O
;	O
see	O
below	O
.	O
</s>
<s>
Many	O
programmers	O
prefer	O
to	O
address	B-General_Concept
memory	I-General_Concept
such	O
that	O
there	O
is	O
no	O
distinction	O
between	O
code	O
space	O
and	O
data	B-General_Concept
space	O
(	O
see	O
above	O
)	O
,	O
as	O
well	O
as	O
from	O
physical	O
and	O
virtual	B-Architecture
memory	I-Architecture
(	O
see	O
above	O
)	O
—	O
in	O
other	O
words	O
,	O
numerically	O
identical	O
pointers	O
refer	O
to	O
exactly	O
the	O
same	O
byte	B-Application
of	O
RAM	O
.	O
</s>
<s>
However	O
,	O
many	O
early	O
computers	O
did	O
not	O
support	O
such	O
a	O
flat	B-General_Concept
memory	I-General_Concept
model	I-General_Concept
—	O
in	O
particular	O
,	O
Harvard	B-Architecture
architecture	I-Architecture
machines	O
force	O
program	O
storage	O
to	O
be	O
completely	O
separate	O
from	O
data	B-General_Concept
storage	O
.	O
</s>
<s>
Many	O
modern	O
DSPs	O
(	O
such	O
as	O
the	O
Motorola	B-General_Concept
56000	I-General_Concept
)	O
have	O
three	O
separate	O
storage	O
areas	O
—	O
program	O
storage	O
,	O
coefficient	O
storage	O
,	O
and	O
data	B-General_Concept
storage	O
.	O
</s>
<s>
Some	O
commonly	O
used	O
instructions	O
fetch	O
from	O
all	O
three	O
areas	O
simultaneously	O
—	O
fewer	O
storage	O
areas	O
(	O
even	O
if	O
there	O
were	O
the	O
same	O
total	O
bytes	B-Application
of	O
storage	O
)	O
would	O
make	O
those	O
instructions	O
run	O
slower	O
.	O
</s>
<s>
Early	O
x86	O
processors	O
use	O
the	O
segmented	B-General_Concept
memory	I-General_Concept
model	I-General_Concept
addresses	O
based	O
on	O
a	O
combination	O
of	O
two	O
numbers	O
:	O
a	O
memory	B-General_Concept
segment	I-General_Concept
,	O
and	O
an	O
offset	B-General_Concept
within	O
that	O
segment	O
.	O
</s>
<s>
Some	O
segments	O
are	O
implicitly	O
treated	O
as	O
code	B-General_Concept
segments	I-General_Concept
,	O
dedicated	O
for	O
instructions	O
,	O
stack	B-General_Concept
segments	O
,	O
or	O
normal	O
data	B-General_Concept
segments	I-General_Concept
.	O
</s>
<s>
Although	O
the	O
usages	O
are	O
different	O
,	O
the	O
segments	O
do	O
not	O
have	O
different	O
memory	B-General_Concept
protections	I-General_Concept
reflecting	O
this	O
.	O
</s>
<s>
In	O
the	O
flat	B-General_Concept
memory	I-General_Concept
model	I-General_Concept
all	O
segments	O
(	O
segment	B-General_Concept
registers	I-General_Concept
)	O
are	O
generally	O
set	O
to	O
zero	O
,	O
and	O
only	O
offsets	B-General_Concept
are	O
variable	O
.	O
</s>
