E; Diskette deinitializer 16-DEC-84 (this comment inserted 16-DEC-85). I; Restores a diskette to just-formatted condition, with "å" on each byte.iI; Modified 16-DEC-85 to eliminate memory protect violation by eliminating 4; reference to PROVOL, and neaten up error messages.D; Linking instructions: Link /PRIV:0 with as high a priority as will=; prevent other tasks from interfering, writing to DZ1:, etc.e; (PRI=249. recommended) bufsiz=50. ; Blocks in buffere# buflen=bufsiz*512. ; Buffer length  volsiz=800. ; Diskette size4 .mcall qiow$s,alun$s, exit$s)?buff: .rept buflen ; Should be in dynamic region to save spacee .byte 229. .endrGwarn: .ascii <27.>/cDiskette Deinitializer: By Nick Zymaris 16-DEC-84/e@ .ascii <15><12><12><27.>/[1mWarning: Will erase everything on /A .ascii /disk without exception. Use at your own risk./<27.>/[m/e0 .ascii <15><12><12>/Press any key to continue./ wrnlen=.-warn3succ: .ascii /Diskette successfully deinitialized./= suclen=.-succoutbuf: .blkb 200.Hdirmsg: .ascii |QIO directive error at or after LBN %P -- I/O Status = |1 .asciz |%P,%P;%N$DSW = %P;%N%D errors so far.%N|e temp: .blkb 1 .evenedblk: .blkw 10.iostat: .blkw 2 ; QIO statusi#errors: .word 0 ; Number of errors1 .chcnz=26. ; Control-Z0 tmo=1 ; Abort after 10 seconds if no response,start: clr errors ; Initialize [16-DEC-85]$ alun$s #5,#"TI,#0 ; Assign terminal alun$s #1,#"DZ,#1 ; Assign DZ1: bcc 1$ ; Continue if no errora. jmp crash ; Crash if error to save hard diskD1$: qiow$s #io.rpr,#5,#2,,#iostat,,<#temp,#1,#tmo,#warn,#wrnlen,#40>! bcs end ; Abort if any problemso tstb iostat ; "p bmi end ; "v% cmpb temp,#.chcnz ; Control-Z typed?; beq end ; If so, abort clr r0 ; Hyperblock counter=;next: qiow$s #io.wlb,#1,#2,,#iostat,,<#buff,#buflen,,#0,r0>p bcc 1$ ; Directive acceptedi& mov #<2$>,-(sp) ; Save return address- br direrr ; JSR to DIRERR (note stack push) #1$: cmpb iostat,#1 ; How 'ya doing?a beq 2$ ; OK * cmp ,#buflen ; Copied all data? beq 2$ ; Yes& mov #<2$>,-(sp) ; Save return address br direrr ; Show error.2$: add #bufsiz,r0 ; Bump to next "hyperblock" cmp r0,#volsiz ; End of volume? blo next ; Not yet; continue0 tst errors ; Any errors occurred? [16-DEC-85]5 bne end ; Don't print success msg if so [16-DEC-85];, qiow$s #io.wvb,#5,#2,,,,<#succ,#suclen,#40>end: exit$s ; Task exit.direrr: mov r0,-(sp) ; Save R0 inc errorss# mov #outbuf,r0 ; Map output bufferO) mov #dirmsg,r1 ; Map unformatted messaget mov #edblk,r2 ; Map format data1 mov (sp),(r2)+ ; Load LBN number ("at or after") mov iostat,(r2)+ ; Load IOSTATx mov iostat+2,(r2)+ ; "v mov @#$dsw,(r2)+ ; Load $DSWx0 mov errors,(r2)+ ; Load number of errors so far" mov #edblk,r2 ; Remap format data" call $edmsg ; Format the message) qiow$s #io.wvb,#5,#2,,,,<#outbuf,r1,#40>s mov (sp)+,r0 ; Restore R0% rts pc ; Return to address on stackv9crash: bpt ; Fatal error -- trap to debugger if presentm" .end start ; End of source code.