regen call restore ;Seek track 0 and set the track counter xra a ;to 0 initially. This counter will sta tkno ;keep track of the current track. mvi a,10 ;Reset read retry sta trcnt ; counter to 10 dloop xra a ;Set for drive A call select ;each read. call wnbusy ;Wait until not busy lxi d,datreg ;Pointer acts as Data Register lxi h,tkbuf ;Track buffer lxi b,24 ; Set page count mvi a,rtcmd ;Set in read track command sta cmdreg ;and execute it. datin ldax d ;Load a data byte mov m,a ;Store in memory inr l ;Bump pointer / counter jnz datin ;Get next byte inr h ;Bump high order dcr c ;Hit page count jnz datin ;Loop til track read in * * Step to next track * tkstep lda sdisk ;Get the source disk and save it mov b,a ;in B. Get desitination disk and see lda ddisk ;if they are the same. If so, do the cmp b ;samedrv routine. jz samedrv mvi a,'*' ;Write an asterisk to the console call pchar ;for each track processed. call takstep ;Step in to next track and back up one lda trkreg ;track to compensate for next series of dcr a ;operations. sta trkreg samedrv xra a ;Default to drive A call select ;and test for current drive- call takstep ;Step in one track in preparation jmp dloop ;for next track manipulation, and go. takstep lxi d,cmdreg ;Point to the command register and mvi a,sicmd ;perform a step-in command. stax d delay05 ldax d rar jnc delay05 Šdelay06 ldax d rar jc delay06 ret