Path: utzoo!utgpu!watserv1!watmath!att!att!linac!uwm.edu!cs.utexas.edu!usc!ucsd!ucbvax!PUCC.PRINCETON.EDU!MQUINN%UTCVM From: MQUINN%UTCVM@PUCC.PRINCETON.EDU Newsgroups: comp.sys.apple2 Subject: Re: Disk // register listing Message-ID: <9011030453.AA02428@apple.com> Date: 3 Nov 90 04:08:43 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 109 On Fri, 2 Nov 90 17:12:29 GMT Charles William Swiger said: >Anybody have a detailed description of the $C0Ex range of addresses? >(Which are the registers that control a 5.25" drive at the lowest level >possible.) > >I've disassembled DOS 3.3 RWTS, the $C600 boot code, parts of ProDOS, >etc and the function of some locations are obvious, but others aren't. >Thanks. > > > >-- Charles William Swiger > cs4w+@andrew.cmu.edu ADDRESS LABEL DESCRIPTION ----------------------------------------------------------------- $C080 PHASEOFF Stepper motor phase 0 off. $C081 PHASEON STEPPER MOTOR PHASE 0 ON. $C082 PHASE1OFF STEPPER MOTOR PHASE 1 OFF. $C083 PHASE1ON STEPPER MOTOR PHASE 1 ON. $C084 PHASE2OFF { } $C085 PHASE2ON { YOU CAN FIGURE } $C086 PHASE3OFF { OUT THESE } $C087 PHASE3ON { } $C088 MOTOROFF TURN OFF MOTOR. $C089 MOTORON TURN MOTOR ON. $C08A DRVOEN ENGAGE DRIVE 1 $C08B DRV1EN ENGANE DRIVE 2 $C08C Q6L STROBE DATA LATCH FOR I/O $C08D Q6H LOAD DATA LATCH. $C08E Q7L PREPARE LATCH FOR INPUT. $C08F Q7H PREPARE LATCH FOR OUTPUT. Q7L WITH Q6L = READ Q7L W/ Q6H = SENSE WRITE PROTECT Q7H W/ Q6L = WRITE Q7H W/ Q6H = LOAD WRITE LATCH --------------------------- You need to at $x0 to $C08n where x is the slot number. --------------------------- Addresses $C080 through $C087 are for moving the drive arm. The arm moves in QUARTER tracks so each access to one 'SET' of those addresses moves the arm 1/4 a track: LDA $C0E0 LDA $C0E1 will move the arm a quarter track ($C0E0 for slot 6). To move a whole track, cycle through the whole set of stepper motor phases: LDA $C0E1 LDA $C0E0 LDA $C0E3 LDA $C0E2 . . LDA $C0E7 LDA $C0E6 The first access to one of these addressess starts up the arm and the other stops it. To move the arm in the opposite direction, cycle through these the other way (the PHASEON of each set always comes first). You must start the drive up before (or turn it on) by accessing $C0E9 first. Immediately after starting it up, you must tell it WHICH drive: LDA $C0EA ----> access drive 1 LDA $C0EB ----> access drive 2 You might want to set it to READ first, immediately after starting up the drive. I can't remember how to do this, you could probably figure it out with the Q6L - Q7H things and a scratch disk. You can also check to see if the disk is write protected with those four addresses, although I can't recall how right now. The data latch out $C0EF is the address you write to to actually write a byte to disk, but you must have enabled write mode first somehow using Q6 and Q7 H&L. To READ from the disk, read from address $C0EE, but you must first anable reading AND allow the drive time to get up to speed. For those of you wondering why ProDOS anly allows two drives per slot, it's probably because there are only two addresses per slot ($C0xA & $C0xB) to determine which drive to access. I got this info from "Beneath Apple DOS"... The most useful book I've ever read to this date. I imagine that "Beneath Apple ProDOS" would be even better. Anyone got a copy they want to sell? By the way, those books are from Quality Software If there is anyone that hasn't read either of these books, I HIGHLY recommend them! "Beneath Apple DOS" covers virtually every conceivable thing you would want to know about DOS 3.3, including copy protection schemes and how to break them and even how to make your own (It's easier to make your own than to crack one :) Even though these books are outdated (well, the ProDOS one may not be), they're still EXTREMELY informative on Disk Operating Systems in General. I find mysel f explaining how DOS's work to sceniors in computer science and even to computer science proffessors just from the stuff I learned from the DOS 3.3 book! ____________________________________________________________________ | | | | This is your brain... | BITNET-- mquinn@utcvm | | This is your brain on drugs... | pro-line: | | This is your brain on frog licking.| mquinn@pro-gsplus.cts.com | |____________________________________|_______________________________|