1541C/1571 trk0 detection code

From: Francesco Messineo <francesco.messineo_at_gmail.com>
Date: Fri, 23 Feb 2024 14:30:59 +0100
Message-ID: <CAESs-_wooMRBT=-GKX7VbUtd8t0HZLDSS6V7qn+yjf0qsgK_fQ_at_mail.gmail.com>
Hi all,
I am studying some aspects of the CBM drives firmware. There's
something I don't quite understand in the 1541C and 1571 added code
for track0 (or rather track 1 in CBM's own numbering scheme).
Here're the relevant parts:

this is the 1541C version, the 1571 version is almost identical in
this section except that it doesn't need to PLA/TAX because it doesn't
use the X register at all:

(FF57 is where the code goes if it determine that the track0 sensor is
triggered by the head being near or at track0, this part is at FF6A on
the 1571)

        FF57 A5 7B      LDA ADRSED   ; drive primary addressed?
        FF59 D0 0B      BNE LFF66       ; yes, move head
        FF5B          LFF5B:
        FF5B 68         PLA                       ; restore Y and X contents
        FF5C A8         TAY
        FF5D 68         PLA
        FF5E AA         TAX
        FF5F A9 00      LDA #$0             ; reset the step counter
        FF61 85 4A      STA STEPS
        FF63 4C BE FA   JMP LFABE       ; jump after the "move head" routine

Now, I'm really puzzled about the test at the beginning, if I
understand it correctly, if the drive is primary addressed, then the
track0 sensor is ignored and this piece of code would jump to the head
movement routine.

Does anyone know why the track0 sensing code needs to check if the
drive is "primary addressed"? I suspect this page zero location was
used for other purposes on both the 1541C and the 1571 but I can't
make sense of the few places where the code writes to it.

Thanks in advance for any hint.
Frank
Received on 2024-02-23 15:00:04

Archive generated by hypermail 2.3.0.