<s>
In	O
computer	B-Application
file	I-Application
systems	I-Application
,	O
a	O
block	B-Application
availability	I-Application
map	I-Application
(	O
BAM	O
)	O
is	O
a	O
data	B-General_Concept
structure	I-General_Concept
used	O
to	O
track	B-Device
disk	B-General_Concept
blocks	I-General_Concept
that	O
are	O
considered	O
free	O
(	O
available	O
for	O
new	O
data	O
)	O
.	O
</s>
<s>
It	O
is	O
used	O
along	O
with	O
a	O
directory	B-Application
to	O
manage	O
files	O
on	O
a	O
disk	B-Device
(	O
originally	O
only	O
a	O
floppy	B-Device
disk	I-Device
,	O
and	O
later	O
also	O
a	O
hard	O
disk	B-Device
)	O
.	O
</s>
<s>
In	O
terms	O
of	O
Commodore	B-Device
DOS	I-Device
(	O
CBM	B-Device
DOS	I-Device
)	O
compatible	O
disk	B-Device
drives	I-Device
,	O
the	O
BAM	O
was	O
a	O
data	B-General_Concept
structure	I-General_Concept
stored	O
in	O
a	O
reserved	O
area	O
of	O
the	O
disk	B-Device
(	O
its	O
size	O
and	O
location	O
varied	O
based	O
on	O
the	O
physical	O
characteristics	O
of	O
the	O
disk	B-Device
)	O
.	O
</s>
<s>
For	O
each	O
track	B-Device
,	O
the	O
BAM	O
consisted	O
of	O
a	O
bitmap	O
of	O
available	O
blocks	B-General_Concept
and	O
(	O
usually	O
)	O
a	O
count	O
of	O
the	O
available	O
blocks	B-General_Concept
.	O
</s>
<s>
The	O
count	O
was	O
held	O
in	O
a	O
single	O
byte	B-Application
,	O
as	O
all	O
formats	O
had	O
256	O
or	O
fewer	O
blocks	B-General_Concept
per	O
track	B-Device
.	O
</s>
<s>
The	O
count	O
byte	B-Application
was	O
simply	O
the	O
sum	O
of	O
all	O
1-bits	O
in	O
the	O
bitmap	O
of	O
bytes	B-Application
for	O
the	O
current	O
track	B-Device
.	O
</s>
<s>
The	O
following	O
table	O
illustrates	O
the	O
layout	O
of	O
Commodore	B-Device
1541	I-Device
BAM	O
.	O
</s>
<s>
The	O
table	O
would	O
be	O
larger	O
for	O
higher-capacity	O
disks	B-Device
(	O
described	O
below	O
)	O
.	O
</s>
<s>
The	O
bitmap	O
was	O
contained	O
in	O
3	O
bytes	B-Application
for	O
Commodore	B-Device
1541	I-Device
format	O
(	O
single-sided	O
)	O
disks	B-Device
because	O
it	O
had	O
17	O
to	O
20	O
sectors	O
per	O
track	B-Device
(	O
note	O
3	O
bytes	B-Application
can	O
hold	O
at	O
least	O
20	O
bits	O
)	O
.	O
</s>
<s>
Similarly	O
,	O
the	O
Commodore	B-Device
1571	I-Device
used	O
3	O
bytes	B-Application
for	O
the	O
bitmap	O
of	O
each	O
track	B-Device
,	O
but	O
the	O
BAM	O
was	O
twice	O
the	O
size	O
because	O
there	O
were	O
twice	O
as	O
many	O
tracks	O
when	O
formatted	O
as	O
double-sided	O
.	O
</s>
<s>
In	O
contrast	O
,	O
the	O
Commodore	O
1581	O
disk	B-Device
drive	I-Device
used	O
5	O
bytes	B-Application
for	O
the	O
bitmap	O
because	O
the	O
disk	B-Device
format	O
had	O
40	O
blocks	B-General_Concept
per	O
track	B-Device
(	O
note	O
5	O
bytes	B-Application
can	O
hold	O
40	O
bits	O
)	O
.	O
</s>
<s>
In	O
the	O
bitmap	O
of	O
any	O
format	O
,	O
a	O
1	O
bit	O
indicated	O
the	O
block	O
was	O
available	O
(	O
free	O
)	O
,	O
while	O
a	O
0	O
bit	O
indicated	O
the	O
block	O
was	O
not	O
available	O
(	O
used	O
)	O
,	O
and	O
the	O
bitmap	O
data	O
was	O
stored	O
low-byte	O
first	O
.	O
</s>
<s>
So	O
the	O
first	O
byte	B-Application
held	O
a	O
map	O
for	O
blocks	B-General_Concept
0	O
to	O
7	O
,	O
the	O
second	O
byte	B-Application
held	O
a	O
map	O
for	O
blocks	B-General_Concept
8	O
to	O
15	O
,	O
and	O
so	O
on	O
.	O
</s>
<s>
Within	O
a	O
byte	B-Application
,	O
the	O
bitmap	O
was	O
ordered	O
low-bit	O
first	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
first	O
byte	B-Application
would	O
represent	O
block	O
0	O
with	O
the	O
least	O
significant	O
bit	O
and	O
block	O
7	O
with	O
the	O
most	O
significant	O
bit	O
.	O
</s>
<s>
Storage	O
devices	O
by	O
Creative	O
Micro	O
Designs	O
,	O
intended	O
for	O
use	O
with	O
CBM	O
computers	O
,	O
also	O
used	O
a	O
Block	B-Application
Availability	I-Application
Map	I-Application
which	O
served	O
the	O
same	O
purpose	O
.	O
</s>
<s>
However	O
,	O
these	O
devices	O
(	O
FD-2000	B-Device
,	I-Device
FD-4000	I-Device
,	O
and	O
CMD-HD	O
)	O
did	O
not	O
include	O
a	O
count	O
byte	B-Application
,	O
and	O
the	O
bits	O
in	O
each	O
byte	B-Application
were	O
reversed	O
(	O
high-bit	O
first	O
)	O
.	O
</s>
<s>
Although	O
the	O
bits	O
were	O
reversed	O
(	O
compared	O
to	O
CBM	O
formats	O
)	O
,	O
the	O
bytes	B-Application
were	O
still	O
stored	O
in	O
the	O
same	O
order	O
(	O
low-byte	O
first	O
)	O
.	O
</s>
<s>
Bitmap	O
byte	B-Application
1	O
Bitmap	O
byte	B-Application
2	O
...	O
Bitmap	O
byte	B-Application
32	O
Track	B-Device
1	O
Blocks	B-General_Concept
0-7	O
Blocks	B-General_Concept
8-15	O
...	O
</s>
<s>
Blocks	B-General_Concept
248-255	O
Track	B-Device
2	O
Blocks	B-General_Concept
0-7	O
Blocks	B-General_Concept
8-15	O
...	O
</s>
<s>
Blocks	B-General_Concept
248-255	O
...	O
...	O
...	O
...	O
...	O
</s>
