💾 Archived View for spam.works › mirrors › textfiles › apple › ANATOMY › t.dos.b800.bcff.txt captured on 2023-06-16 at 21:12:04.

View Raw

More Information

-=-=-=-=-=-=-









PRENIBL LDX #0
 LDY #2
PRENIB1 DEY
 LDA (PTR2BUF),Y ;GET BYTE FROM "DATA" BUFFER.
 LSR ;PUT ITS LWR 2 BITS IN2 RWTSBUF1.
 ROL RWTSBUF2,X
 LSR
 ROL RWTSBUF2,X
 STA RWTSBUF1,Y ;PUT REMAINING 6 BITS N RWTSBUF1.
 INX
 CPX #$56
 BCC PRENIB1
 LDX #0
 TYA
 BNE PRENIB1 ;REPEAT UNTIL @ BYTE OF RWTSBUF2
;HAS 6 BITS.
 LDX #$55 ;MAKE SURE BITS 6 & 7 OF RWTSBUF2
PRENIB2 LDA RWTSBUF2,X ;ARE ZEROES.
 AND #%00111111
 STA RWTSBUF2,X
 DEX
 BPL PRENIB2
 RTS







WRITESEC SEC ;(C)=1, ASSUME WRITE PROTECTED
;ERROR AS DEFAULT CONDITION.
 STX FRMTSLOT ;SAVE SLOT*16 IN PAGES 0 & 6.
 STX SLOTPG6
 LDA Q6H,X ;CHK IF DISK IS WRITE PROTECTED.
 LDA Q7L,X
 BMI PROTECTD ;BRANCH IF WRITE PROTECTED.
 LDA RWTSBUF2 ;GET 1RST 2-ENCODED BYTE AND SAVE
 STA HOLDNIBL ;IT FOR LATER USE.



 LDA #$FF ;(A) = SYNC BYTE.
 STA Q7H,X ;WRITE 1 SYNC BYTE.
 ORA Q6L,X
 PHA ;(3 CYC)
 PLA ;(4 CYC)
 NOP ;(2 CYC)
 LDY #4 ;WRITE 4 MORE SYNCS (2 CYC).
WRITE4FF PHA ;(3 CYC)
 PLA ;(4 CYC)
 JSR WRITE2 ;(12 CYC BEFORE, 6 AFTER.)
 DEY ;(2 CYC)
 BNE WRITE4FF ;(2 OR 3 CYC)



 LDA #$D5 ;(2 CYC)
 JSR WRITE1 ;(14 CYCS BEFORE, 6 AFTER.)
 LDA #$AA ;(2 CYC)
 JSR WRITE1 ;(14 CYCS BEFORE, 6 AFTER.)
 LDA #$AD ;(2 CYC)
 JSR WRITE1 ;(14 CYCS BEFORE, 6 AFTER.)





 TYA ;(A) = 0.
 LDY #$56 ;(DEC #86.)
 BNE DOEOR ;ALWAYS.
GETNIBL LDA RWTSBUF2,Y
DOEOR EOR RWTSBUF2-1,Y
 TAX ;INDEX TO DISK BYTE.
 LDA DSKNBTBL,X ;GET DISK BYTE.
 LDX FRMTSLOT ;(X) = SLOT*16.
 STA Q6H,X ;WRITE BYTE.
 LDA Q6L,X
 DEY ;(Y) = $56 --> #$00.
 BNE GETNIBL ;(WRITE $56 OR DEC #86 BYTES.)



 LDA HOLDNIBL ;NORMALLY = CONTENTS OF $BC00.
 NOP
SCNDEOR EOR RWTSBUF1,Y
 TAX ;INDEX TO DISK BYTE.
 LDA DSKNBTBL,X ;GET DISK BYTE TO WRITE.
 LDX SLOTPG6 ;(X) = SLOT*16.
 STA Q6H,X ;WRITE 87TH ---> 341ST BYTES.
 LDA Q6L,X
 LDA RWTSBUF1,Y
 INY ;(Y) = #$00 ---> #$FF.
 BNE SCNDEOR



 TAX ;INDEX TO TABLE OF DISK BYTES.
 LDA DSKNBTBL,X ;GET DISK BYTE TO WRITE.
 LDX FRMTSLOT ;(X) = SLOT*16.
 JSR WRITE3 ;(5 CYCS BEFORE, 6 AFTER.)



 LDA #$DE ;(2 CYC)
 JSR WRITE1 ;(14 CYCS BEFORE, 6 AFTER.)
 LDA #$AA ;(2 CYC)
 JSR WRITE1 ;(14 CYCS BEFORE, 6 AFTER.)
 LDA #$EB ;(2 CYC)
 JSR WRITE1 ;(14 CYCS BEFORE, 6 AFTER.)



 LDA #$FF ;(2 CYC)
 JSR WRITE1 ;(14 CYCS BEFORE, 6 AFTER.)
 LDA Q7L,X ;SET READ MODE.
PROTECTD LDA Q6L,X
 RTS




WRITE1 CLC ;(2 CYC)
WRITE2 PHA ;(3 CYC)
 PLA ;(4 CYC)
WRITE3 STA Q6H,X ;(5 CYC) - SHIFT REGISTER)
 ORA Q6L,X ;(4 CYC - STROBE LATCH)
 RTS ;(6 CYC)






POSTNB16 LDY #0
POSTNIB1 LDX #$56 ;(DEC #86.)
POSTNIB2 DEX
 BMI POSTNIB1
 LDA RWTSBUF1,Y ;SET (A) = 6-ENCODED BYTE.
 LSR RWTSBUF2,X ;PUT LWR 2 BITS OF 2-ENCODED BYTE
 ROL ;INTO ORIGNAL 6-ENCODED BYTE TO
 LSR RWTSBUF2,X ;CREATE A NORMAL MEMORY BYTE.
 ROL
 STA (PTR2BUF),Y ;PUT NORMAL MEMORY BYTE IN RWTS'S
 INY ;BUF (NORMALLY DOS DATA SEC BUF).
 CPY PROSCRTH
 BNE POSTNIB2
 RTS








READATA LDY #32 ;SET (Y) = 32 ATTEMPTS TO FIND
REDUCEY DEY ;THE DATA PROLOGUE.
 BEQ ERRTN ;ERROR - CAN'T FIND DAT PROLOGUE.
PRODATD5 LDA Q6L,X ;GET BYTE FROM DATA PROLOGUE.
 BPL PRODATD5 ;WAIT FOR FULL BYTE.
VERSD5 EOR #$D5 ;CHK IF BYTE WAS "D5".
 BNE REDUCEY ;WASN'T "D5", REDUCE COUNTER.
 NOP ;STALL 2 CYCLES.
PRODATAA LDA Q6L,X ;READ NEXT DATA PROLOGUE BYTE.
 BPL PRODATAA ;WAIT FOR FULL BYTE.
 CMP #$AA ;WAS IT AN "AA"?
 BNE VERSD5 ;NO - GO RESTART SEQUENCE.
 LDY #$56 ;SET (Y) FOR LATER USE IN READ
;DATA ROUTINE.
PRODATAD LDA Q6L,X ;READ NEXT BYTE IN DATA PROLOGUE.
 BPL PRODATAD ;WAIT FOR FULL BYTE.
 CMP #$AD ;WAS IT AN "AD"?
 BNE VERSD5 ;NO - GO RESTART SEQUENCE.



 LDA #0 ;INITIALIZE (A) FOR LATER EORING.
RDUCY DEY ;REDUCE INDEX TO RWTSBUF2.
 STY PROSCRTH ;SAVE INDEX.
RDSKBYT LDY Q6L,X ;(Y) = DISK BYTE.
 BPL RDSKBYT ;WAIT FOR FULL BYTE.
 EOR NDX2NIBL-$96,Y ;USE (Y) AS INDEX TO TABLE OF
;2-ENCODED NIBBLES.
 LDY PROSCRTH ;RETRIEVE INDEX TO SECOND BUF.
 STA RWTSBUF2,Y ;STORE 2-ENCODED NIBL N RWTSBUF2.
 BNE RDUCY ;Z-FLG CONDITIONED FRM THE "LDY".



SAVYNDX STY PROSCRTH ;SAVE INDEX TO RWTSBUF1.
RDSKBYT2 LDY Q6L,X ;(Y) = DISK BYTE.
 BPL RDSKBYT2 ;WAIT FOR FULL BYTE.
 EOR NDX2NIBL-$96,Y ;GET 6-ENCODED NIBL FRM TBL.
 LDY PROSCRTH ;GET INDEX TO RWTSBUF1.
 STA RWTSBUF1,Y ;STORE 6-ENCODED NIBL N RWTSBUF1.
 INY
 BNE SAVYNDX ;MORE DISK BYTES TO READ.



RDCHECK LDY Q6L,X ;GET DATA CHECKSUM BYTE FROM DSK.
 BPL RDCHECK ;WAIT FOR FULL BYTE.
 CMP NDX2NIBL-$96,Y ;DOES CONVERTED CHKSUM EQUAL
;THE VALUE IN $BBFF?
;REMEMBER: VAL IN $BBFF IS RESULT
;OF PREVIOUS CUMMULATIVE EORING.
;THERE4, THIS COMPARISON WITH (A)
;DETECTS ANY (NON-CANCELLING)
;ERROR(S) THAT MAY HAVE OCCURRED
;IN THE ENTIRE SECTOR!!!
 BNE ERRTN ;ERROR -DIDN'T MATCH WITH CHKSUM.
;HACKERS OFTEN CHANGE THESE TWO
;BYTES 2 "CLC" AND "RTS" INSTRUCS
;IN ORDER TO DEFEAT DATA CHECKSUM
;AND IGNORE THE DATA EPILOGUE.



EPIRDDE LDA Q6L,X ;READ 1RST BYTE OF DATA EPILOGUE.
 BPL EPIRDDE ;WAIT FOR FULL BYTE.
 CMP #$DE ;IS IT A "DE"?
 BNE ERRTN ;NO - GOT AN ERROR.
 NOP ;STALL 2 CYCLES.
EPIRDAA LDA Q6L,X ;READ 2ND BYTE OF DATA EPILOGUE.
 BPL EPIRDAA ;WAIT FOR FULL BYTE.
 CMP #$AA ;IS IT AN "AA"?
 BEQ GOODRTN ;YES - GOT A GOOD READ.
ERRTN SEC ;SIGNAL BAD READ.
 RTS ;HACKERS OFTEN CHANGE THE "SEC" 2
;"CLC" TO DEFEAT ERROR CHECKING.








RDADDR LDY #$FC ;SET 772 CHANCES TO FIND CORRECT
 STY PROSCRTH  ;ADR PROLOGUE (#$FCFC-#$10000).
KICKNTR INY
 BNE TRYD5
 INC PROSCRTH
 BEQ ERRTN ;ERROR - CAN'T FIND PROLOGUE.



TRYD5 LDA Q6L,X
 BPL TRYD5 ;WAIT FOR A FULL BYTE.
VERSUSD5 CMP #$D5 ;WAS IT "D5"?
 BNE KICKNTR ;NO - TRY AGAIN.
 NOP ;WAIT 2 CYCLES.
TRYAA LDA Q6L,X
 BPL TRYAA ;WAIT FOR FULL BYTE.
 CMP #$AA ;WAS IT "AA"?
 BNE VERSUSD5 ;NO - RETRY SEQUENCE.
 LDY #3 ;SET (Y) 4 LATER READING OF VOL,
;TRK, SEC & CHKSUM INFO FROM THE
;ADRRESS FIELD.
TRY96 LDA Q6L,X
 BPL TRY96 ;WAIT FOR A FULL BYTE.
 CMP #$96 ;WAS IT "96"?
 BNE VERSUSD5 ;NO - RETRY SEQUENCE.



 LDA #0 ;INTIALIZE FOR RUNNING CHECKSUM.
CALCK STA CKSUMCAL
GETHDR LDA Q6L,X ;GET ODD-ENCODED BYTE.
 BPL GETHDR ;WAIT FOR A FULL BYTE.
 ROL ;SHIFT BITS, PUT (C)=1 IN BIT0.
 STA PROSCRTH ;SAVE SHIFTED VERSION.
RDHDR LDA Q6L,X ;GET EVEN-CODED BYTE.
 BPL RDHDR ;WAIT FOR A FULL BYTE.
 AND PROSCRTH ;MERGE & CREATE NORM MEMORY BYTE.
 STA: CKSUMDSK,Y ;STORE INFO READ FROM ADDR FIELD
;IN Z-PAGE:
;2F = VOL FND, 2E = TRK FND,
;2D = SEC FND, 2C = CHECKSUM FND.
;(NOTE "STA:" FORCES 3-BYT CODE.)
 EOR CKSUMCAL ;UPDATE RUNNING CHECKSUM.
 DEY
 BPL CALCK
 TAY ;PUT CHECKSUM FOUND IN (Y).
 BNE ERRTN ;IF CHKSUM FOUND < > 0 THEN ERR.
;HACKERS OFTEN CHANGE THESE TWO
;BYTES 2 "CLC" AND "RTS" INSTRUCS
;IN ORDER 2 DEFEAT THE ADR CHKSUM
;AND IGNORE THE ADR EPILOGUE.



TRYEPIDE LDA Q6L,X ;GET 1RST BYTE.
 BPL TRYEPIDE ;WAIT FOR A FULL BYTE.
 CMP #$DE ;WAS IT A "DE"?
 BNE ERRTN ;NO - TRY AGAIN.
 NOP ;STALL 2 CYCLES.
TRYEPIAA LDA Q6L,X ;GET 2ND BYTE.
 BPL TRYEPIAA ;WAIT FOR A FULL BYTE.
 CMP #$AA ;WAS IT AN "AA"?
 BNE ERRTN ;NO - RETRY SEQUENCE.
GOODRTN CLC ;SIGNAL GOOD READ.
 RTS






SEEKABS STX SLT16ZPG ;SAVE SLOT*16 IN ZERO PAGE.
 STA DESTRK ;SAVE DESTINATION HALFTRK#.
 CMP PRESTRK ;DESTINATION 1/2TRK=PRES 1/2TRK?
 BEQ ARRIVED ;YES-WE'RE ALREADY THERE, SO XIT.
 LDA #0 ;INIT COUNTER 4 # OF TRKS MOVED.
 STA STPSDONE



SAVCURTK LDA PRESTRK ;SAVE CURRENT HALFTRK POSITON.
 STA HOLDPRES
 SEC ;CALC (PRESTRK-DESTRK).
 SBC DESTRK
 BEQ ATDESTN ;AT DESTINATION SO GO SHUTDOWN.
 BCS MOVDOWN ;PRES 1/2TRK > DESTINATION 1/2TRK
;SO WANT 2 MOVE 2 LOWER 1/2TRK#.



 EOR #$FF ;CONVERT NEG TO POS.
 INC PRESTRK ;MOVING UP,SO INC CURRENT HALFTRK
;POS'N FOR NEXT TIME AROUND.
 BCC CKDLYNDX ;ALWAYS.



MOVDOWN ADC #$FE ;SIMULATE A SUBTRATION OF 1.
;ACTUALLY ADDING MINUS 1 (#$FF)
;CAUSE (C)=1.  WANT (A) TO EQUAL
;1 LESS THAN # OF HALFTRKS 2 MOV.
 DEC PRESTRK ;MOVING DOWN, REDUCE PRES HALFTRK
;NUMBER FOR NEXT TIME AROUND.





CKDLYNDX CMP STPSDONE ;COMPARE # OF HALFTRKS ALREADY
;MOVED VS # HALFTRKS NEED 2 MOVE.
 BCC CLSR2ND ;CLOSER TO DEST'N THAN START.



 LDA STPSDONE ;(A) = DISTANCE FROM START POS'N.



CLSR2ND CMP #12 ;ARE WE WITHIN 12 STEPS OF START
;OR DESTINATION POS'N?
 BCS TURNON ;WE ARE AT OR BEYOND 12 STEPS FRM
;START OR DEST'N POS'N SO USE OLD
;INDEX TO ACCESS DELAY TABLE.
PRESNDX TAY ;USE PRES DISTANCE 2 INDEX TABLE.
TURNON SEC ;(C)=1 SO GET ODD INDEX TO BASE
;ADR SO MAGNET WILL BE TURNED ON.
 JSR ONOROFF ;TURN MAGNET ON TO SUCK STEPPER
;MOTOR 2 CORRECT HALFTRACK POS'N.
 LDA ONTABLE,Y ;GET TIME TO LEAVE MAGNET ON.
 JSR DELAY ;DELAY TO GIVE DRIVE TIME TO ACT
;BEFORE MAGNET TURNED OFF AGAIN
;CAUSE COMPUTER IS TOO FAST FOR
;PERIPHERAL & WANT SMOOTH MOV'T.
 LDA HOLDPRES ;(A) = LAST HALFTRK POS'N.
 CLC ;CLR (C) SO INDEX WILL COME OUT
;EVEN & THERE4 MAGNET WILL BE
;TURNED OFF.
 JSR ENTRYOFF ;TURN OFF THE MAGNET ASSOC WITH
;PREVIOUS POS'N.
 LDA OFFTABLE,Y ;GET TIME TO LEAVE MAGNET OFF.
 JSR DELAY ;LEAVE MAGNET OFF FOR A WHILE TO
;GIVE ARM TIME TO BE PROPERLY
;ALIGNED.  (NEED TIME TO SUCK IT
;OVER & ALSO TO DECREASE BOUNCE
;OR OVER SHOOT.)
 INC STPSDONE
 BNE SAVCURTK ;ALWAYS.




ATDESTN JSR DELAY ;WAIT ON PERIPHERAL AGAIN.



 CLC ;CLR (C) SO NDX WILL COME OUT AS
;EVEN & THERE4 MAGNET WILL BE
;TURNED OFF.



ONOROFF LDA PRESTRK ;USE HALFTRK POS'N 2 INDEX MAGNET
ENTRYOFF AND #%00000011 ;ONLY KEEP LWR 2 BITS OF HALFTRK#
;BECAUSE ONLY 4 MAGNETS (0,1,2,3)
 ROL ;MULTIPLY HALFTRK * 2 & ADD (C).
;IF (C)=0, RESULT EVEN, MAG OFF
;IF (C)=1, RESULT ODD, MAGNET ON.
 ORA SLT16ZPG ;MERGE INDEX 2 MAGNET WITH SLOT#.
 TAX ;USE (X) TO INDEX MAGNET ON/OFF.
 LDA MAG0FF,X ;USE MAGNET-0-OFF AS BASE ADR.
 LDX SLT16ZPG ;RESTORE (X) = SLOT*16.
ARRIVED RTS




 HEX AAA0A0 ;UNUSED.




DELAY LDX #17
DLY1 DEX
 BNE DLY1
 INC MTRTIME
 BNE DLY2
 INC MTRTIME+1
DLY2 SEC
 SBC #1
 BNE DELAY
 RTS







ONTABLE HEX 01302824201E1D1C1C1C1C1C




OFFTABLE HEX 702C26221F1E1D1C1C1C1C1C




DSKNBTBL HEX 96979A9B9D9E9F
 HEX A6A7ABACADAEAF
 HEX B2B3B4B5B6B7B9BABBBCBDBEBF
 HEX CBCDCECF
 HEX D3D6D7D9DADBDCDDDEDF
 HEX E5E6E7E9EAEBECEDEEEF
 HEX F2F3F4F5F6F7F9FAFBFCFDFEFF






CKIFAPND LDX NDX2CMD ;GET COMMAND INDEX.
 CPX #$1C ;ARE WE APPENDING?
 BEQ RTNCKAPN ;YES - LEAVE APPEND FLAG ON.
 LDX #0 ;NO - MAKE SURE APPEND FLG OFF.
 STX APPNDFLG
RTNCKAPN RTS




CONTCLOB LDA #$FF ;SET MODE FLAG FOR CARD.
 STA $4FB ;SCRATCH PAD MEMORY FOR SLOT3.
 STA $C00C ;TURN OFF THE ALTERNATE CHAR SET.
 STA $C00E
 JMP INIT ;SIMULATE A TEXT STATEMENT.




 DS 18






NDX2NIBL HEX 0001 ;     VALID INDICES.
 HEX 9899 ;     2 SPACERS.
 HEX 0203 ;     VALID INDICES.
 HEX 9C ;     1 SPACER.
 HEX 040506 ;     VALID INDICES.
 HEX A0A1A2A3A4A5 ;   6 SPACERS.
 HEX 0708 ;     VALID INDICES.
 HEX A8A9AA ;     3 SPACERS.
 HEX 090A0B0C0D ;     VALID INDICES.
 HEX B0B1 ;     2 SPACERS.
 HEX 0E0F10111213 ;   VALID INDICES.
 HEX B8 ;     1 SPACER.
 HEX 1415161718191A ; VALID INDICES.
 HEX C0C1C2C3C4C5 ;   6 SPACERS.
 HEX C6C7C8C9CA ;     5 SPACERS.
 HEX 1B ;     VALID INDEX.
 HEX CC ;     1 SPACER.
 HEX 1C1D1E ;     VALID INDICES.
 HEX D0D1D2 ;     3 SPACERS.
 HEX 1F ;     VALID INDEX.
 HEX D4D5 ;     2 SPACERS.
 HEX 2021 ;     VALID INDICES.
 HEX D8 ;     1 SPACER.
 HEX 22232425262728 ; VALID INDICES.
 HEX E0E1E2E3E4 ;     5 SPACERS.
 HEX 292A2B ;     VALID INDICES.
 HEX E8 ;     1 SPACER.
 HEX 2C2D2E2F303132 ; 7 INDICES.
 HEX F0F1 ;     2 SPACERS.
 HEX 333435363738 ;   VALID INDICES.
 HEX F8 ;     1 SPACER.
 HEX 393A3B3C3D3E3F ; VALID INDICES.




RWTSBUF1 DS 256






RWTSBUF2 DS 86






WRITADR SEC ;(C)=1, ASSUME ERROR AS DEFAULT.
 LDA Q6H,X ;CHK IF DISK IS WRITE PROTECTED.
 LDA Q7L,X
 BMI SET4RD ;BRANCH IF WRITE PROTECTED.





 LDA #$FF ;(A) = SYNC BYTE.
 STA Q7H,X ;SET WRITE MODE.
 CMP Q6L,X
 PHA ;(3 CYC)
 PLA ;(4 CYC)
WRTSYNC JSR WTADDRTN ;(12 CYC)
 JSR WTADDRTN ;(12 CYC)
 STA Q6H,X ;(5 CYC)
 CMP Q6L,X ;(4 CYC), WRITE BYTE.
 NOP ;(2 CYC)
 DEY ;(2 CYC)
 BNE WRTSYNC ;(3 CYC ON BRNCH, 2 ON FALL THRU)



 LDA #$D5 ;(2 CYC)
 JSR WRBYTE3 ;(24 CYC BEFORE, 6 AFTER)
 LDA #$AA ;(2 CYC)
 JSR WRBYTE3 ;(24 CYC BEFORE, 6 AFTER)
 LDA #$96 ;(2 CYC)
 JSR WRBYTE3 ;(24 CYC BEFORE, 6 AFTER)



 LDA FRMTVOL ;(A) = VOLUME #, (3 CYC).
 JSR WRBYTE1 ;WRITE BYTES FOR VOLUME.
;(JSR INSTRUCTION = 6 CYC.)
 LDA FRMTKCTR ;WRITE BYTES FOR TRK.
;(3 CYC + 6 FROM BEFORE.)
 JSR WRBYTE1 ;(6 CYC + 17 MORE CYC, WITH
;6 RESIDUAL CYC.)
 LDA FRMTSEC ;WRITE BYTES FOR SEC.
 JSR WRBYTE1 ;(CYCLES AS PER ABOVE.)



 LDA FRMTVOL ;(3 CYC + 6 FROM BEFORE)
 EOR FRMTKCTR ;(3 CYC)
 EOR FRMTSEC ;(3 CYC)
 PHA ;SAVE CKSUM ON STK (3 CYC).



 LSR ;(2 CYC)
 ORA HOLDAA ;(3 CYC)
 STA Q6H,X ;(5 CYC - WRITE BYTE)
 LDA Q6L,X ;(4 CYC)



 PLA ;(3 CYC)
 ORA #%10101010 ;(2 CYC)
 JSR WRBYTE2 ;(26 CYC BEFORE WRITE, 6 AFTER)



 LDA #$DE ;(2 CYC + 6 LEFT OVER FRM B4.)
 JSR WRBYTE3 ;(24 CYC BEFORE WRITE, 6 AFTER)
 LDA #$AA ;(2 CYC + 6 LEFT OVER FROM B4)
 JSR WRBYTE3 ;(24 CYC B4 WRITE, 6 LFT OVER)
 LDA #$EB ;(2 CYC + 6 LEFT OVER FROM B4)
 JSR WRBYTE3 ;(24 CYC BEFORE WRITE, 6 AFTER)
 CLC
SET4RD LDA Q7L,X ;SET READ MODE.
 LDA Q6L,X
WTADDRTN RTS






WRBYTE1 PHA ;(3 CYC)



 LSR ;(2 CYC)
 ORA HOLDAA ;(3 CYC)
 STA Q6H,X ;(5 CYC)
 CMP Q6L,X ;(4 CYC)



 PLA ;(4 CYC)
 NOP ;(2 CYC)
 NOP ;(2 CYC)
 NOP ;(2 CYC)
 ORA #$AA ;(2 CYC)
WRBYTE2 NOP ;(2 CYC)
WRBYTE3 NOP ;(2 CYC)
 PHA ;(3 CYC)
 PLA ;(4 CYC)
 STA Q6H,X ;(5 CYC)
 CMP Q6L,X ;(4 CYC)
 RTS  ;(6 CYC LEFT OVER AFTER WRITE)




 DS 33 ;UNUSED  GARBAGE - CONSIDER FREE.