D5 AA 96, do you have any idea about the meaning of these three bytes? While moving my vintage collection, I spotted these bytes a few weeks ago on a 5”1/4 floppy signed by Woz – Steve Wozniak. If, for any odd reasons, you don’t know who Woz is, he is the engineer behind Apple. You know, the other Steve, the one that knows electronics and coding. To me, Steve Wozniak is an absolute genius, a model engineer, and the Apple computers’ creator. In particular, the Apple II – and of course the Apple I, but I never owned one, and I do not plan to drop half-million dollars or more to buy an original. Nevertheless, I will soon start a series of posts about the Apple IIgs, the most successful of the series. And it will be the about the Woz edition, of course.
Before revealing the meaning of D5 AA 96, let me give you a bit of background. When the Apple II launched, it used cassette tapes to store programs and data. A standard technology used by numerous computers released during the late ‘70s and early ‘80s. Even the IBM PC defaults to the cassette interface in its first BIOS. If you ever used cassette tapes, though, you know how crap the user experience was. Well, if you were poor, it worked. But if you had money, a lot, you could use a floppy disk! Memba the scene in WarGames (1983 – directed by John Badham) where David (Matthew Broderick) inserts an 8” floppy into his IMSAI dual floppy disk unit? That’s the only scene you need to see to know it is a Sci-Fi flick. To everybody else, a floppy drive was a distant dream.
The users of the Apple II needed the read/write speed, the capacity, and the reliability of a floppy disk. Steve Wozniak took on the challenge to develop one for the Las Vegas CES show. He had two weeks to accomplish this tour de force. You can read the details of this story as Woz itself relates it in the iWoz book. You can download a copy from the Internet Archive here. I am refering here to pages 121-217. An excellent read, I strongly recommend. You can learn how he applied the Woz-magic to his design: remove everything useless, do software-defined hardware a million light-years ahead of the curve! As an excellent pedagog, he explains his approach, his creation, and the essential techniques he used in a way anyone can understand. If you want more details, you can also read the patent owned by Apple (I attached screenshots) or, even better, read Woz’s code! How? Boot your Apple II, type CALL -151, followed by C65CL. Et voila! You’ll see the exact assembler routine that searches the D5 AA 96 bytes sequence, a marker of the beginning of a sector header. Can you spot D5, AA, and 96?
Steve explains his problem of locating the data on the floppy in iWoz: “I was scared for a week or so as I built my controller that I wouldn’t be able to solve this. But I did come up with some abnormal patterns that could be written onto the floppy disk but didn’t translate back to data. I would write about sixteen of these patterns in a row, and when they read back into my state machine, they automatically kept shifting it in time until it lined up with where the bytes would actually be, then my program, in the computer, continually looked for a couple of start bytes, called ‘mark bytes,’ which I’d write to indicate the start bytes, called a ‘sector.’ Along with the data for each sector, I’d write the sector number of the data on the floppy so that the reading program would be sure it was writing the correct sector. (If the reading sector ever determined the data was wrong, it would try again).”
At the same time, because of the software nature of Woz’s design, it also opened the door to exciting copy protection techniques used by publishers messing with the way data was stored on the disks and cracking techniques used by the hackers to break them! I remember using Locksmith’s nibble copy feature to make backup copies of those expensive games 🙂