30.12.2013 Views

May June 1980 - Commodore Computers

May June 1980 - Commodore Computers

May June 1980 - Commodore Computers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MAY/JUNE. I <strong>1980</strong>. 198O ISSUE 4. COMPUTE. 105 1O5<br />

OBSERVATIONS USING THE BAM MAP<br />

PROGRAM<br />

The BAM turns ofT off the bits when it allocates a<br />

sector. The BAM Map Program looks at these bits<br />

and if the bit is on (meaning it is free and has not<br />

been allocated) it will print either a "~~ "&" : " or a white<br />

sqare. By looking at the map you can determine<br />

how full or empty the disk is.<br />

Varying numbers of sectors.<br />

The reason for the varying number of sectors per<br />

track is LO to pack more data on the disk. Using the<br />

worse case which is 17 sectors per track and propagate<br />

throughout the disk would decrease the number<br />

of sectors per track by 95 sectors or 24k.<br />

Sectors not contiguous<br />

The sectors are in 255 byte blocks. A program<br />

file, which is stored in 255 bytes, is not written<br />

on the disk contiguously but wrillen written approximately<br />

one-halftrack apart. . Using thee BAM program, m , you<br />

can see when youu save a program on a empty disk,<br />

that DOS will save the first 255 bytes on track 17<br />

secLOr sector 0, the second 255 bytes on sector 10, the<br />

third 255 bytes on sector 3, and so on. The purpose<br />

of these gaps is to speed up the processing by not<br />

S0<br />

El<br />

C2<br />

T3<br />

0 4<br />

R5<br />

6<br />

~<br />

to<br />

II<br />

TRACKS TRftCKS 11111111112222222222333333<br />

1234567891312345678901234567891312345<br />

123456785012345678581234567B90I3345<br />

12<br />

13<br />

14<br />

15<br />

16<br />

17<br />

IS 18<br />

19<br />

2Q 20 wsmmmmmmmmt—free blks= s?e<br />

CKS TRACI(S 111111111112222222222333333<br />

U11111112222222222333333<br />

12343678901234567890123456765012345<br />

12345678901234567890123456789012345<br />

se Sfi<br />

I<br />

El<br />

I<br />

C2<br />

II<br />

I<br />

T3<br />

04<br />

• I<br />

I<br />

R5<br />

6<br />

• I<br />

I<br />

7<br />

8 "<br />

I<br />

I<br />

9<br />

18 10<br />

I<br />

I<br />

11 II<br />

12 •<br />

I<br />

I<br />

13<br />

14 I "<br />

I<br />

I<br />

15 I<br />

It 16 I • I<br />

17 I<br />

18 I<br />

,-- 19 I • .--<br />

I<br />

I I DR*=EMPTV<br />

OR*=EMPT'y'<br />

20 I<br />

l"FREE :REE BLKS= £lLKS= @ £I<br />

References:<br />

Parsons, s, James Jamcs C, C .. "Display y Track and d Sector", Scctor", <strong>Commodore</strong><br />

Newsletter Ncwslclle!' Vol. 1I Number 8, January <strong>1980</strong>.<br />

.<br />

<strong>Commodore</strong> Business ti ll Machines, <strong>Commodore</strong> CBM C Dual Floppy<br />

py<br />

Disk Model 2040 User U SCI' Manual, al , July J y 1979.<br />

waiting for a full rotation of the disk. If the pro­<br />

waiting for a full rotation of the disk. If the pro<br />

gram was written contiguously after each write, , DOS<br />

would have to wait an entire rot rotation of the disk to<br />

write the next sequental sector. Thus, when one is<br />

looking g at the BAM Map, one will see where alternating<br />

sectors are allocated.<br />

ing sectors are allocated.<br />

Allocation of sectors<br />

DOS allocates disk space very efficiently. SecLOrs<br />

Sectors<br />

are allocated around the directory (track 18) . This<br />

are allocated around the directory (track 18). This<br />

reduces the read/write head movement because it reads<br />

the directory first, , then reads the fil file. By having the<br />

file e close to the directory, head movement is reduced. .<br />

Where sectors are allocated<br />

When you delete the first program on a full disk,<br />

the BAM Map will show free sectors near the directory.<br />

When you save a new program, it will start by<br />

allocating those free sectors nearest the directory and<br />

will start filling in where you deleted the old file.<br />

If thee new program is larger than the old program,<br />

it will tJ'>' try to (o allocate sectors further and further<br />

from thee directory. By using this allocation technique,<br />

the need for a disk compress is eliminated.<br />

PROGRAM EXPLANATION<br />

PROGRAM EXPLANATION<br />

100-170 Initialization<br />

180-190 Which drive?<br />

200-430 Prints s the BAM Map outline. .<br />

100 REM* REI·l* BLOCK ACCESS METHOD NETHOD DUMP *<br />

110 REM* WRITTEN BY TOM T011 CONRAD *<br />

120 REM*<br />

130 REM* RE~I*<br />

140 REM* INITIALIZATION<br />

I NITIAL IZATION *<br />

150 DIM A(4)<br />

160 NL$=CHR$(0)<br />

170 T=0: REM REI1 TOTAL FREE BLOCKS<br />

175 REM* REI1* WHICH DRIVE *<br />

180 PRINT"fiVHHDRIVE? "fifttWDRIVE?""<br />

190 GET D$: IF D$="" GOTO 190<br />

195 REM* PRINTS THE BAM MAP ~lAP OUTLINE *<br />

200 PRINT"fi rTRACKSr LTRACKSf 111111111122222<br />

-.22222333333"<br />

, 210 PRINT" 123456789012345678901234567<br />

8 -.89012345"<br />

,89012345"<br />

220 PRINT"! PRINT"} $$$SS$$$SS$S$$$$SSSSSSSSSSS<br />

$$$$$$$$$$$$$$$$$$$$$$$$$$$<br />

-,$$$$$$$S"<br />

,$$$$$$$$"<br />

230 PRINT"rSr0_L<br />

"LSf0.'. '<br />

, 1"<br />

240 PRINT"xEfll<br />

".r.Efl.'.<br />

,<br />

-i<br />

1"<br />

250 PRINT"j:Cr21<br />

".r.Cf2.'.<br />

, 1 "<br />

260 PRINT"rTf31<br />

".r.TD.'.<br />

, 1"<br />

270 PRINT"iOr4J.<br />

"Lof4.'. ,<br />

, 1 "<br />

280 PRINTnrRf51<br />

".r.Rf5.'.<br />

, 1 "<br />

290 PRINT" " 61 6.'.<br />

,<br />

-i ■1 "<br />

300 PRINT" 71 7.'.<br />

, 1"

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!