Skip to main content
Home Documents Lisa NREAD16.Text
NREAD16.Text

NREAD16.Text

FilenameNREAD16.Text
Size0.00 MB
Subsection firmware / ROM88
Downloads0
Contents
.Page ;++ ; ; NRead16 ; ; NRead16 assumes that the disk is spinning at the proper speed ; and the head is located at the proper Side/Track and that the header ; for the sector desired has already been found. First it will read in ; the beginning data marks, then the data, and finally the trailing data ; bytes. It will abort if the proper starting or ending sequence of ; data bytes is not found. ; ; REGISTERS ; IN ; All = Any value ; OUT ; All = Destroyed ; ;-- .Org 1800 .Page Read16 .Equ * Jsr SetRMode ; Setup PAL on Sony to read mode Jsr RDSynTop ; Read the sync nibbles Bcc $03 ; If bitslip marks found then carry = 0 Rts $03 Ldy #0F4 ; 2 15 First time only 12 bytes RdBF01 .Equ * Inc InxPtrH ; 5 28 Point to next page RdBF02 .Equ * Ldx Q7L ; 4 Bpl RdBF02 ; 2,3 Lda DNibl,x ; 4 10 Map from 8 bits ==> 6 bits Asl A ; 2 12 Asl A ; 2 14 Tax ; 2 16 Save temporarily Asl A ; 2 18 Asl A ; 2 20 Sta Temp1 ; 3 23 >BBCC0000< Txa ; 2 25 And #0C0 ; 2 27 >AA000000< $10 Ldx Q7l ; 4 Read low bits of byte A Bpl $10 ; 2,3 Ora DNibl,x ; 4 10 Combine low and high bits Sta @InxPtrL,y ; 6 16 Lda Temp1 ; 3 19 >BBCC0000< Iny ; 2 21 Bne $20 ; 2,3 23/24 Inc InxPtrH ; 5 28 Point to next page $20 Ldx Q7L ; 4 Read low bits of byte B Bpl $20 ; 2,3 And #0C0 ; 2 8 >BB000000< Ora DNibl,x ; 4 12 Add low & high bits Sta @InxPtr,y ; 6 18 Iny ; 2 20 Beq RdCSM01 ; 2/3 22/23 Lda Temp1 ; 3 24 >BBCC0000< Asl A ; 2 26 Asl A ; 2 28 $30 Ldx Q7L ; 4 Read low bits of byte C Bpl $30 ; 2,3 And #0C0 ; 2 8 >CC000000< Ora @DNibl,x ; 4 12 Add low and high bits Sta @InxPtr,y ; 6 18 Iny ; 2 20 Beq RdBF01 ; 2/3 22/23 Inc to next page if = 0 Bne RdBF02 ; 3 25 Branch always taken .Page RdCSM01 .Equ * ; Read 4 bytes of checksum Ldx Q7L ; 4 Bpl RdSCM01 ; 2,3 Lda DNibl,x ; 4 10 Map from 8 bits ==> 6 bits Asl A ; 2 12 Asl A ; 2 14 Tay ; 2 16 >AABBCC00< And #0C0 ; 2 18 >AA000000< $10 Ldx Q7L ; 4 Read low bits of byte A Bpl $10 ; 2,3 Ora Dnibl,x ; 4 10 Add low and high bits Sta Cksum1 ; 3 13 Tya ; 2 15 Asl A ; 2 17 Asl A ; 2 19 Tay ; 2 21 >BBCC0000< And #0C0 ; 2 23 >BB000000< $20 Ldx Q7L ; 4 Read low bits of byte B Bpl $20 ; 2,3 Ora DNibl,x ; 4 10 Add high and low bits Sta Cksum2 ; 3 13 Tya ; 5 15 Asl A ; 2 17 Asl A ; 2 19 >CC000000< $30 Ldx Q7L ; 4 Read low bits of byte C Bpl $30 ; 2,3 Ora DNibl,x ; 4 10 Combine low and high bits Sta Cksum3 ; 3 13 Rd9 Lda Q7L ; 4 Check bitslip mark 1 Bpl Rd9 ; 2,3 Cmp DatMk4 ; 3 Bne BSErr ; 2,3 Rd10 Lda Q7L ; 4 Check bitslip mark 2 Bpl Rd10 ; 2,3 Cmp DatMk5 ; 3 Bne BSErr ; 2,3 Clc RdExit Lda Q6H ; Sense mode RdWaste Rts .Page BSErr Inc BSCnt ; Trailing bitslip mark & error counter Sec Bcs RdExit ; Return to Sense mode & exit CSErr Inc CsErr ; Checksum error counter RdErr Sec Bcs RdExit RdErr2 Inc StSlp ; S…

Showing first 3,000 characters of 3,737 total. Open the full document →

MacTrove — a free archive of classic Macintosh software. Files mirrored from ftp.funet.fi/pub/mac (info-mac + funet legacy). All software provided for historical preservation.