Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am now programming on a 8 bits Z80 computer with CP/M 2.2, (as a hobby) and the floppy disk format is IBM, 40 tracks, 8 sectors per track, 512 bytes per sector. free space is 154 Ko on each face of the disk.

Why the sectors are indexed 1 to 8 (and not zero to seven, as usually is seen with computers)?

The catalog of the floppy disk is on the track 1 (sector 1 to 4, 64 entries).

I'm wondering is the catalog on track zero?

Is the zero track reserved to included a system (as track 0 & 1 are reserved to the system on a CP/M floppy disk, and catalog is on track 2)?


I asked this because for example, on APPLE II, sectors start at zero (0 to F).

The computer I use is an AMSTRAD CPC 6128 (1985). It is a 8 bits with Zilog Z-80, with CP/M OS 2.2 and 3.0 available.

The floppy disk format is pretty rare : 3 inches. (not 3 1/2).

3 FORMATS are available : -CP/M : 40 tracks (0 to 39) 9 sectors per track (named &41 to &49) 169 Ko on each face. -DATA : 40 tracks (0 to 39) 9 sectors per track (named &C1 to &C9) 178 Ko on each face. -IBM : 40 tracks (0 to 39) 8 sectors per track (named 1 to 8) 154 Ko free space on each face.

A 3 inch floppy disk is différent of a 3 1/2 floppy disk. To read the side B: I have to eject the diskette and turn it myself then put it again in the disk drive! but it works very well.

The tracks start at 0 to 39. I am just curious to know why sectors start at 1, and why the track 0 is not use for the directory on the IBM format...

For example, CP/M format is very simple : directory on track 2, system CP/M on track 0 and 1.

I am an experienced assembly programmer, and I think it would be logic that sectors start at zero, as tracks do. The AMSTRAD CPC computer can accept a 5 1/4 disk drive too. I bought one yesterday. But tracks,sectors and formats will be the same of course on 5 1/4 disquettes.

Olivier.

p.s: sorry for my english, it is not my native language. ^^

share|improve this question
    
Sometimes something is the way it is because that's the way it is. (And keep in mind that the floppy format goes back some very early partly electromechanical key-to-disk data entry systems. Which is to say that mechanical engineers had as big a hand in the design as EEs.) –  Daniel R Hicks Apr 1 '12 at 22:57
    
40 tracks are you sure? That would be a single-sided 5.25" diskette. Or do you mean 40 cylinders and double-sided diskettes? BTW CP/M typically supported both 8" and 5.25" floppies, single and double sided diskettes, single and double density recording formats, and an assortment of sector sizes (256, 512 and 1024 were common). IBM's PC-DOS supported both SS and DS 5.25" floppies, and help standardize 512 bytes per sector. –  sawdust Apr 2 '12 at 0:25
    
The question in your title is not tied to "IBM floppy disk", but goes back to the "standard" floppy disk controllers from the IBM 3740 and IBM System 34, which became the standards for single and double density recording formats. The numbering schemes were designed by hardware engineers and implemented for command sequences, and not designed by software engineers or programmers. –  sawdust Apr 2 '12 at 0:38

1 Answer 1

I think you have a misconception that things regarding computers start at zero.

While this is the case with all C based languages (C, C++, C#, Java, etc) it is NOT true for some languages that are as old, or older than C (like FORTRAN and COBOL).

Since the Z80 was introduced before ANSI C, it was expected to be running much more COBOL and FORTRAN than Lisp (which is also very old, but has zero based indexing).

As such, the one based indexing makes sense.

share|improve this answer
1  
The Zilog Z80 microprocessor and any programming languages it might have supported have nothing to do the floppy controller standards. Floppies were invented before the Z80 showed up. –  sawdust Apr 2 '12 at 0:09
    
@sawdust, it has much more to do with standards in general at the time. Since at the time many things were expected to be one indexed, floppys were too. –  soandos Apr 2 '12 at 0:33
    
Your "explanation" does not account for the fact that the cylinder number and head number are numbered from zero, not one. –  sawdust Apr 2 '12 at 0:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.