ERØcÿ” - ‰.LION;" ÄÒÉÖÅ " (‰.LIOFF2-<-!F;FOLGENDELAUFWERKSFUNKTIONENP;SINDENTHALTEN:Z;1.EINLESENDERSECTORID'Sd;‚EINESTRACK'Sn;2.EINLESENDERDATENFELDERx;3.TABELLIERUNGDERSTATI‚;4.FORMATIERUNGMITTELSŒ;‚INTERLEAVING –;5.SCHREIBENDERDATENFELDER ;‚UNDIHRERSTATIª;´;STAND:‚26/11/86'¾-ȉ.OR$8000ÒSDRV0„JSRSEM0 ܉LDAXSAV#æ‰STZSTBUFƒ;CLEARDRIVESTATUSð‰JSRTSTWRPú‰AND#$80„;KLAPPEOFFEN?‰BNE.1†;FEHLER!‰LDX#2†;ANZAHLRETRYS .13†PHX"-,‰JSRREADH6‰JSRCONRES @‰JSRMOVEJ-T;TESTAUF18HEADER^-h‰PLXr‰DEX |‰BEQ.12 †‰LDAXSAV‰CMP#$7F„=18*7+1 š‰BNE.13¤-®.12†JSRRDSEC¸- ‰JMPSEM1Ì-(Ö;STBUF=STATUS,DERZUMCOMPUTER‰GEHT.à- ê.1‡LDA#1ô‰STASTBUF þ‰JMPSEM1-!;CRCERRORIMDATENFELDENTD.-&.2‡JSRSPECVERI 0‰LDA#$80:‰STAHEADBUF+$17D D‰JMPSEM1N-XSTBUF„.HX00b-l;MODULSCHREIBEN:v-€SDRV1„JSRSEM0#Š‰STZSTBUFƒ;CLEARDRIVESTATUS+”‰LDA#20…;GAPLAENGEZWISCHENDATENUND(ž‰STAFGAP„;IDFIELD(SECTOR/SECTOR)¨-²‰JSRMOTON9¼‰JSRTSTWRP‚;TESTOBKLAPPEOFFENODERWRITEPROTECTƉBNE.1†;FEHLER!Ð-.Ú;ICHGEHEDAVONAUS,DASESMOEGLICHIST,<ä;19SEKTOREN(MITDATEN)INŒEINEMTRACKZUFORMATIEREN.4î;DAZUWERDENDIEGAPSAUFEINŠMINIMUMGEKUERZT.ø;ESBLEIBTZUTESTEN:;; ;>KOENNENDANNINEINERUMDREHU‰NGALLEERFORDERLICHEN(;‚DATENZURUECK-GESCHRIEBENWERDEN?2 ;>WIRDBEIJEDEMLAUFWERKRICHT‰IGFORMATIERT*-4‰LDAHEADBUF+$17F;‚HILEN >‰CMP#9 H‰BCC.3 R‰BEQ.2\‰BCS.4†;AETZERFORMAT!f.2‡LDAHEADBUF+$17E;‚LOLEN p‰BEQ.3z-#„;BEQID.NORMALFORMAT$900BYTESŽ-˜‰LDA#10…;ENGERESFORMAT! ¢‰STAFGAP(¬.3‡LDAHEADBUF+$17B;‚FORMATRETRIES ¶‰AND#7 À.31†PHA'ʉJSRWTRACK‚;FORMATTRACKFUNCTIONÔ‰PLA$Þ‰BCC.32…;ERRORDURINGFORMAT?è‰DEA ò‰BNE.31…;NOMORERETRIES!ü‰BEQ.4†;FORMATERROR(.32†LDAHEADBUF+$17B;WRITERETRIES ‰AND#7 .33†PHA$‰JSRWRSEC.‰PLA 8‰BCC.34B‰DEA L‰BNE.33$V‰BEQ.44…;WRITEERROR(TIMEOUT)"`‰LDAHEADBUF+$17B;VERIFYON? j‰BPL.34t‰JSRVERIFY ~‰BCS.45ˆ.34†JMPSEM1’-œ.45†LDA#4‚;VERIFYERRROR¦‰.HX2C†=BITABS.°.44†LDA#3ƒ;WRITEERRORº‰.HX2C†=BITABS.$Ä.4‡LDA#2ƒ;ILLEGALFORMATERRORΉ.HX2C†=BITABS.Ø.1‡LDA#1ƒ;FATALERRORâ‰STASTBUF ì‰ORA#$F0ö‰JSRHEXOUT‰JMPSEM1„;SENDERROR?! -FGAP….HX14-&(;HIERBEGINNENDIEDIENSTŽROUTINEN2-<RDSEC„LDY#0„;SETPARF‰STYCSEC‚;TOZERO P‰STYYSAVZ‰LDA#SECBUF;SETBUFFERd‰STA$19…;POINTERn‰LDA/SECBUF x‰STA$1A ‚‰LDAXSAV Œ‰BNE.2–‰RTS -ª.2‡LDYYSAV´‰LDAHEADBUF+3,Y;SET¾-ȉJSRRDSEC1Ò- ܉LDYCSECæ‰STAHEADBUF+$100,Y ð‰INCCSEC ú‰AND#$10 ‰BNE.1-‰LDA$19„;INCBUFFER "‰EOR#$80 ,‰STA$19 6‰BMI.1 @‰INC$1AJ.1‡LDAYSAVT‰CLC ^‰ADC#7 h‰STAYSAV r‰CMPXSAV |‰BCC.2 †‰LDA$19‰STAHEADBUF+$17E š‰LDA$1A¤‰SEC®‰SBC/SECBUF¸‰STAHEADBUF+$17F ‰LDACSEC ̉STATSECÖ‰RTSà-ê;DIEFUNKTIONSORTIERTDEN ô;HEADERBUFFERUM,DAMITEINEþ;ERHOEHTEGESCHWINDIGKEIT#;BEIMSEKTORLESENERZIEHLTWIRD-VAL2….HX00&-$0MOVE…LDYHEADBUF+$FF;ZUNAECHST4:‰CPY#21‚;TESTE,OBDREIHEADER(3*7)VORHANDEND‰BCCMVERR N‰LDX#0X-5b.1‡LDAHEADBUF,X;MOVED14BYTESAUFDENSTACK!l‰PHAv‰INX €‰CPX#147Š‰BCC.1†;JETZTLIEGTHEADBUF+13AUFDEMSTACKOBEN”‰TYAž‰SEC ¨‰SBC#14 ²‰STAVAL2¼- ƉLDY#0Ð.2‡LDAHEADBUF+14,YÚ‰STAHEADBUF,Yä‰INY î‰CPYVAL2 ø‰BCC.2- ‰LDYHEADBUF+$FF ‰LDX#13 .3‡PLA*‰STAHEADBUF-1,Y4‰DEY>‰DEX H‰BPL.3 RMVERR„RTS\-fWRBTSLƒBVCFORTOpWRBYTSƒBIT$280z‰BPLWRBTSL „‰STA$403Ž‰DEY˜‰BNEWRBYTS¢‰RTS ¬FORTO„PLA¶‰PLAÀ‰SECʉRTSÔ-ÞWRBTL„BVCFORTOèWRBYTEƒBIT$280ò‰BPLWRBTL ü‰STA$403 ‰RTS - WTRST„LDA#5 $ ‰STA$29F. ‰LDA#$F8„;WRITE8 ‰STA$400„;TRACK B ‰LDA#0 L ‰LDX#2V .1‡BIT$280 ` ‰BPL.1 j ‰STA$403t ‰DEX ~ ‰BNE.1 ˆ ‰LDY#$D0 ’ ‰STY$29Fœ ‰CLC¦ ‰RTS° -º ;FORMATIERFUNKTION1.Ä -Î WTRACKƒSTZCSEC Ø ‰STZYSAVâ -ì ‰JSRWTRSTö - ‰LDY#80…;ACCU=0 ‰JSRWRBYTS‚;WRITE40x ‰LDA#$FC‚;INDEXMARK ‰JSRWRBYTE( .1‡LDA#$FF2 ‰LDYFGAP„;NORMAL:20< ‰JSRWRBYTS‚;ACCU=00 F ‰LDA#0 P ‰LDY#5Z ‰JSRWRBYTSd -n ‰LDA#$FE„;SECTORIDx ‰JSRWRBYTE‚ ‰LDA$D†;=TRACKŒ ‰JSRWRBYTE – ‰LDYYSAV  ‰LDAHEADBUF+2,Y;=SIDEª ‰JSRWRBYTE´ ‰LDAHEADBUF+3,Y;SECTOR¾ ‰JSRWRBYTEÈ ‰LDAHEADBUF+4,Y;SECLENÒ ‰JSRWRBYTEÜ -æ ;JETZTFOLGEN2CRCBYTES!ð -ú ‰LDAHEADBUF,Y  ‰BEQ.2 ‰LDA#$20„;SETDD  ‰TRB$280" .2‡LDA#$F7, ‰JSRWRBYTE6 ‰LDA#$20‚;SETSD @ ‰TSB$280 J ‰LDY#17 T ‰LDA#$FF^ ‰JSRWRBYTS h ‰LDYCSECr ‰LDAHEADBUF+$100,Y| ‰AND#$10‚;MASKOUT† ‰BNE.3†;RNF ‰LDAHEADBUF+$17D š ‰BNE.31¤ -® ;RAUMFUERDATENFELD¸ - .32†LDA#$FB„DATAAMÌ ‰JSRWRBYTEÖ ‰LDY#$82„DATAFIELD à ‰LDA#$FFê ‰JSRWRBYTSô -þ .3‡INCCSEC  ‰LDAYSAV ‰CLC  ‰ADC#7 & ‰STAYSAV 0 ‰CMPXSAV : ‰BCC.1 D ‰LDA#1N .11†AND$400 X ‰BEQ.12 b ‰BIT$280 l ‰BPL.11 v ‰STZ$403 € ‰JMP.11 Š .12†CLC” ‰RTSž -¨ .31†LDXCSEC² ‰LDAHEADBUF+$120,X ¼ ‰BEQ.32Æ ‰PHAÐ ‰LDA#$FB„DATAAMÚ ‰JSRWRBYTEä ‰PLAî ‰PHAø ‰TAY  ‰LDA#$FF ‰JSRWRBYTS  ‰LDA#$FB ‰JSRWRBYTE* ‰PLA4 ‰SEC > ‰SBC#$80 H ‰EOR#$FFR ‰TAY\ ‰INY f ‰LDA#$20 p ‰LDX#$F0z .40†BIT$280 „ ‰BVC.41 Ž ‰BPL.40 ˜ ‰STX$403¢ ‰DEX¬ ‰DEY ¶ ‰BEQ.42 À ‰TRB$280Ê -Ô .45†BIT$280 Þ ‰BVC.41 è ‰BPL.45 ò ‰STX$403 ü ‰TSB$280‰DEX‰DEY ‰BNE.40$.42†TSB$280 .‰JMP.3 8.41†PLAB‰PLAL‰SECV‰RTS`->j;DIEWRITE-SECTORROUTINEHATˆKEINABBRUCH-KRITERIUMBEI#t;TIMEOUTODERRECORDNOTFOUND.~;DASHEISST: ˆ;ABSTURZBEIENDLOSSCHLEIFE.’;KEINRETRYFLAG.œ-¦WRSEC„STZCSEC °‰STZYSAVº‰LDA#SECBUF;SETBUFFERĉSTA$19„;POINTERLOΉLDA/SECBUF؉STA$1A„;POINTERHIâ-ì.15†LDY#$A8ö‰LDXCSEC„;INDEXX‰LDAHEADBUF+$17D ‰BEQ.50‰LDAHEADBUF+$120,X ‰BNE.30(.50†LDAHEADBUF+$100,X2‰ASL†;NOTREADY->C<‰ASL†;WR.PROT.->CF‰ASL†;C=1DEL.DAM P‰BCC.19Z‰INYd;n.19†ASL‰;RNF->C x‰BCS.21‚‰ASLˆ;CRCERR->CŒ‰PHPˆ;SAVCARRY –‰LDXYSAV ‰LDAHEADBUF+3,Xª‰STA$402ƒ;SETSEC.´- ¾‰STY$400 ȉLDY#0Ò‰LDA#$E6„;SET܉STA$29F„;TIMEOUTæ.11†LDA($19),Y ð‰EOR#$FFú.10†BIT$280‰BVC.22…;TIMEOUT?‰BPL.10…;DRQ? ‰STA$403"‰INY ,‰BPL.116-@;$80BYTESGESCHRIEBENJ-T‰LDAHEADBUF+4,X;ID^‰BEQ.12„;SECLEN=0?h‰JSRCONRESr.12†PLP‰;GETCARRY|‰BCC.13„;CRCERROR? †‰LDA#$20‰TAY š‰TRB$280¤.13†LDA$400®‰LSR ¸‰BCS.13‰TYA ̉TSB$280Ö-à.1‡LDA$19 ê‰EOR#$80 ô‰STA$19 þ‰BMI.21 ‰INC$1A.21†INCCSEC ‰LDAYSAV&‰CLC 0‰ADC#7 :‰STAYSAV D‰CMPXSAV N‰BCC.15X‰CLCb‰RTSl.22†JSRCONRESv‰PLP€‰SECŠ‰RTS”-ž.30†STAZSAV ¨‰LDXYSAV²‰LDAHEADBUF+3,X¼‰STA$402„;SECTORÆ-ЉLDY#$A8‚WRITESECTOR Ú‰STY$400 ä‰LDY#0î‰LDA#$E6ƒ;SETø‰STA$29Fƒ;TIMEOUT.31†LDA($19),Y ‰EOR#$FF.40†BIT$280 ‰BPL.40…;DRQ? *‰STA$4034‰INYˆ;YINRANGE>‰CPYZSAVƒ;OF0-$7F! H‰BCC.31R‰JSRCONRES \‰JMP.1fZSAV….HX00p-zTRK00„JSRMOTON„‰JSRTRACK0 Ž‰STZ$D˜‰JMPSENDC¢-!¬;READSECTOR,ACCU=SECTORNO¶-)ÀRDSEC1ƒSTA$402ƒ;SETSECTORREGISTERʉLDA#$88‚;READSECTOR Ô‰STA$400Þ- è‰LDY#0ò‰LDA#$E6‚;TIMEOUT ü‰STA$29F.1‡BIT$280 ‰BVC.2 ‰BPL.1 $‰LDA#$A .‰STA$29F 8‰LDA$403 B‰EOR#$FFL‰STA($19),YV‰INY`.3‡BIT$280 j‰BVC.5 t‰BPL.3 ~‰LDA$403 ˆ‰EOR#$FF’‰STA($19),Yœ‰INY¦‰BPL.3†;$80BYTES °‰LDA#1º.4‡AND$400 ĉBNE.4 ΉLDA$400 ؉AND#$3Eâ‰RTSì.2‡JSRCONRES ö‰LDA#$10‰RTS .5‡JSRCONRES ‰LDA#4‰RTS(-2REFORMƒJSRSEM0<‰JSRMOTONF‰JSRCLRTRAP‰JMPSENDCZ-dSEM0…LDA$82 n‰STAXSAV x‰LDA$83 ‚‰STA$DŒ‰JMPTRACKPO–- SEM1…JSRSENDC ª‰LDA#1´‰LDX#STBUF¾‰LDY/STBUFȉJMPSDBTSÒ-ÜVERIFYFLG.HX00æ-ðSPECVERILDX#$20ú.1‡STZHEADBUF+$120,X‰DEX ‰BPL.1 ‰LDA#0"‰.HX2C†=BITABS.,-6VERIFYƒLDA#1@‰STAVERIFYFLGJ‰LDY#0†;SETPART‰STYCSEC„;TOZERO ^‰STYYSAVh‰LDA#SECBUF;SETBUFFERr‰STA$19…;POINTER|‰LDA/SECBUF †‰STA$1A ‰LDAXSAV š‰BNE.2¤‰CLC®‰RTS¸.2‡LDYCSEC‰LDAHEADBUF+$100,Y ̉AND#$10 Ö‰BNE.1 à‰LDYYSAVê‰LDAHEADBUF+3,Y;‚SETô‰JSRRDSEC2„;SECTORþ‰LDAVERIFYFLG‚;CARRY‰BEQ.13‡;BLEIBT‰BCS.99‚;UNVERAENDERT-&.13†LDA$19„;INCBUFFER 0‰EOR#$80 :‰STA$19 D‰BCC.1 N‰INC$1AX.1‡INCCSEC b‰LDAYSAVl‰CLC v‰ADC#7 €‰STAYSAV Š‰CMPXSAV ”‰BCC.2ž‰CLC¨‰RTS²- ¼.99†SECƉRTSÐ-ÚRDSEC2ƒSTA$402 ä‰LDA#1î.11†AND$400 ø‰BNE.11- ‰LDA#$88 ‰STA$400 - *‰LDY#04‰LDA#$FF„;TIMEOUT >‰STA$29FH.1‡BIT$280 R‰BVC.2 \‰BPL.1 f‰LDA$403 p‰EOR#$FFz‰CMP($19),Y „‰BNE.2Ž‰LDA$296‚;STOPTIMER?˜‰INY¢.3‡BIT$280 ¬‰BPL.3 ¶‰LDA$403 À‰EOR#$FFʉCMP($19),Y Ô‰BNE.2Þ‰INYè‰BPL.3†;$80BYTES ò‰LDA#0 ü‰LDYCSEC‰STAHEADBUF+$120,Y‰JSRCONRES‰CLC$‰RTS..2‡LDXCSEC8‰TYAB‰STAHEADBUF+$120,XL‰JSRCONRESV‰SEC`‰RTSj-tCRCCHECKLDY#0 ~‰STYYSAVˆ‰TYA’.1‡ORAHEADBUF+$100,Yœ‰INY ¦‰CPYTSEC °‰BCC.1 º‰AND#8ĉCMP#1„;IFZEROC=1ΉRTSØ-â;HEADERLESEFUNKTION:ì-öREADH„LDX#0…;LOCALVEC‰STXHEADBUF+$17D ‰STXYSAVƒ;GLOBALVEC-.2‡LDA#$D6 (‰STA$29F2.3‡JSRRDHD1;GETNEXTHD <‰BCS.4F‰TAX P‰LDA$7A Z‰CMP$D d‰BNE.3 n‰LDA$7C x‰BEQ.3 ‚‰CMP#19 Œ‰BCS.3–‰TXA -ª‰JSRSHTABƒ;©HD ´‰JMP.3¾-È.4‡LDYYSAV Ò‰BEQ.6܉LDAHEADBUF+3æ‰CMPHEADBUF-4,Y ð‰BNE.5ú‰TYA‰SEC ‰SBC#7‰TAY "‰BRA.6,.5‡CMPHEADBUF-11,Y 6‰BNE.6@‰TYAJ‰SEC T‰SBC#14^‰TAYh;r.6‡STYXSAV|‰STYHEADBUF+$FF†‰RTS-.š;SETZEHEADERUNDSTATUSIMŒHEADERBUFFER:¤;AUFBAUDESPUFFERS:)®;BYTE:0ISTDERSTATUSDIESESHEADERS¸;ƒ1ENTSPRICHTDEMTRACKÂ;ƒ2„" "‚SEITENBYTEÌ;ƒ3„" "‚SECTOR>Ö;ƒ4„" DER LAENGE (NACH IBM STANDARD)à;ƒ61.CRCBYTEê;ƒ72.CRCBYTEô-þSHTAB„LDYYSAV‚;GETY‰STAHEADBUF,Y‰INY ‰LDX#$7A&.1‡LDA$0,X0‰STAHEADBUF,Y:‰INYD‰INX N‰BPL.1 X‰STYYSAVb‰RTSl-v;DRIVEDISPLAYCONTROL€-ŠMEMDOOR‚.HX00”BELL…=$FF99žCLRDSPƒ=$FF9C¨HEXOUTƒ=$FFA5²DOORCHECK=$FF6F¼CNT†.HX0000 ÆLOOP…=7Ð-3ÚDISKWAITSTZ$1D…;LASTDOORPOSITIONISCLOSED ä‰LDA#19î‰TRB$282ƒ;DAMITERHAELTDERPOKEYEINSERIALFRAME.ø‰STZMEMDOOR- START„JSRCLRDSP ‰STZCNT ‰LDA#LOOPƒ;7*‰STACNT+14- >‰LDA#$FFH‰STA$4002 R‰LDA#$CD\‰JSRHEXOUT f‰JSRBELLp-:z.0‡JSRDISKCHECK‚;ISTDIEKLAPPEGESCHLOSSENWORDEN? „‰BCS.3…;C=1=>DISKCHANGEŽ-4˜‰JSRESCTEST‚;ISTIMCOMPUTER'ESC'GEDRUECKT?¢‰BCS.3…;C=1=>ESCAPE¬- ¶‰DECCNT À‰BNE.0ʉDECCNT+1 Ô‰BNE.0Þ-è;2.SCHLEIFE.ò-ü‰JSRCLRDSP ‰STZCNT‰LDA#LOOPƒ;7‰STACNT+1$-:..1‡JSRDISKCHECK‚;ISTDIEKLAPPEGESCHLOSSENWORDEN? 8‰BCS.3…;C=1=>DISKCHANGEB-4L‰JSRESCTEST‚;ISTIMCOMPUTER'ESC'GEDRUECKT?V‰BCS.3…;C=1=>ESCAPE`- j‰DECCNT t‰BNE.1~‰DECCNT+1 ˆ‰BNE.1’‰JMPSTARTœ- ¦.3‡LDA#1 °‰TSB$282º‰JMPCLRDSPÄ-ÎCARRYCƒCLC؉RTSâCARRYSƒSECì‰RTSö-DISKCHECKLDAMEMDOOR ‰BNE.1-;LAUFWERKKLAPPEGEOEFFNET?(-2‰JSRDOORCHECK <‰AND#$80F‰BEQCARRYCP‰STAMEMDOORZ-d;KLAPPEGESCHLOSSEN?n-x.1‡JSRDOORCHECK ‚‰AND#$80Œ‰BEQCARRYS–‰BRACARRYC -ªESCTEST‚LDA$282´‰TAX ¾‰AND#2 ȉBEQ.1Ò‰JMP($FFFC) Ü.1‡TXA æ‰AND#$80 ð‰CMP#$80ú‰RTS-ACTIVATELDA#$82„;SETSD‰STA$9†;FORKEN"‰STA$A†;FORKEN2,‰JSRSDRDDP 6‰LDA#$2C@‰STA$17…;STEPTIMJ‰LDA$9F80T‰STABEREIT^‰LDA$9F80+1h‰STABEREIT+1r‰LDA#NORM|‰STA$9F80†‰LDA/NORM‰STA$9F80+1š-¤NORM…STZ$1D ®‰LDA$282 ¸‰AND#2 ‰BNE.1̉JMP(BEREIT)Ö.1‡JMP($FFFC)à-êBEREITƒ.DA$E100 ôDRVEND