home *** CD-ROM | disk | FTP | other *** search
- include "dh0:code/include/exec/exec_lib.i"
- last = 2*20 * letzter Block (11*79*2)
-
-
-
- _LVOOutput equ -60 ;DOS: Output-Handle holen
- _LVOWrite equ -48 ; Ausgabe
-
- x: move.l a0,clineadd * cli-command addr
- move.l d0,clinelen * cli-command lenght
-
-
- _main move.l #dosname,a1 ;Name der DOS-Lib
- moveq #0,d0 ;Version egal
- move.l _SysBase,a6 ;Basis Exec
- jsr _LVOOpenLibrary(a6) ;DOS-Lib oeffnen
- tst.l d0 ;Fehler?
- beq fini ;wenn Fehler, Ende
- move.l d0,DOSBase ;Zeiger merken
-
- move.l #text1,tsource
- move.l #(text1e-text1),tlaenge
- bsr print
-
- bra clicommand
- cli_return:
-
-
- move.l #0,a1
- CALLEXEC FindTask * Task suchen
- move.l d0,ReplyPort+16 * MsgPort
- lea ReplyPort,a1 * initialisieren und
- CALLEXEC AddPort * einfügen
-
-
- lea DiskIO,a1 * IOTrackDisk laden
- move.l drive,d0 * Laufwerk dfx (0)
- moveq #0,d1 * keine Spezial-Flags
- lea DevName,a0 * Name des Devices
- CALLEXEC OpenDevice * Device öffnen
- tst.l d0 * hat's geklappt?
- beq starttest
-
- move.l #noDrive,tsource
- move.l #(noDrivee-nodrive),tlaenge
- bsr print
- bra Abort
-
-
- ******************************************************************************
- starttest:
- move.l #search,tsource
- move.l #(searche-search),tlaenge
- bsr print
- newline:
- cmp.b #"f",parameter : free (no output)
- beq nosturctur1
- bsr enter
- bsr trackprint
- nosturctur1: move #5,trackcount
- newtrack: bsr loadblock
- bsr fillbuffer
- bsr compare0
- bsr comparedos
- bsr comparexcopy
- cmp.b #"f",parameter : free (no output)
- beq nosturctur
- cmp.b #"a",parameter : all (symboles)
- beq all
- bsr normmode
- all: move.l #printbuffer,tsource
- move.l #12,tlaenge
- bsr print
- nosturctur:
- add #11,curblock
- move lasblock,d0
- move curblock,d1
- add #1,d0
- cmp d1,d0
- bmi endoftest
- sub #1,trackcount
- bmi newline
- bra newtrack
-
-
-
-
-
- ******************************************************************************
- endoftest: bsr enter
- bsr printfree
-
- ende: lea DiskIO,a1
- CALLEXEC CloseDevice * Device schließen
-
-
-
- Abort: lea ReplyPort,a1
- CALLEXEC RemPort * Port entfernen
-
-
-
-
- move.l DOSBase,a1 ;Basis der Lib
- move.l _SysBase,a6 ;Basis Exec
- jsr _LVOCloseLibrary(a6) ;Funktion "Schliessen"
-
-
-
- fini: move.l #0,d0
- rts ;Return zum CLI
-
-
-
-
- ******************* S U B R O U T I N E S *******************************
- compare0:
- lea buffer,a0
- lea printbuffer,a1
- move.l a0,a2
- move #11-1,d6
- cp0_0:
- cmp.b #"1",(a1)
- bne cp0_e
- move.l a2,a0
- move #512-1,d7
- cp0_1: cmp.b #0,(a0)+
- bne cp0_e
- dbf d7,cp0_1
- move.b #"0",(a1)
- add #1,emptyblocks
- cp0_e:
- lea 1(a1),a1
- add.l #512,a2
- dbf d6,cp0_0
- rts
- comparedos:
- lea buffer,a0
- lea printbuffer,a1
- move.l a0,a2
- move #11-1,d6
- cpd_0:
- clr nibbelcount
- move #512-1,d7
- cmp.b #"1",(a1)
- bne cpd_e1
- move.l a2,a0
- move #512-1,d7
- cpd_1: cmp.b #"D",(a0)+
- beq cpd_2
- dbf d7,cpd_1
- bra cpd_e
- cpd_2: cmp.b #"O",(a0)+
- beq cpd_3
- dbf d7,cpd_1
- bra cpd_e
- cpd_3:
- * cmp.b #"S",(a0)+
- * beq cpd_4
- * dbf d7,cpd_1
- * bra cpd_e
- cpd_4:
- add #1,nibbelcount
- dbf d7,cpd_1
- bra cpd_e
-
- cpd_e:
- cmp #120,nibbelcount
- bmi cpd_e1
- add #1,emptyblocks
- move.b #"D",(a1)
- cpd_e1: lea 1(a1),a1
- add.l #512,a2
- dbf d6,cpd_0
- rts
- comparexcopy:
- lea buffer,a0
- lea printbuffer,a1
- move.l a0,a2
- move #11-1,d6
- cpx_0:
- clr nibbelcount
- move #512-1,d7
- cmp.b #"1",(a1)
- bne cpx_e1
- move.l a2,a0
- move #512-1,d7
- cpx_1: cmp.b #"X",(a0)+
- beq cpx_2
- dbf d7,cpx_1
- bra cpx_e
- cpx_2: cmp.b #"C",(a0)+
- beq cpx_3
- dbf d7,cpx_1
- bra cpx_e
- cpx_3:
- cmp.b #"O",(a0)+
- beq cpx_4
- dbf d7,cpx_1
- bra cpx_e
- cpx_4:
- cmp.b #"P",(a0)+
- beq cpx_5
- dbf d7,cpx_1
- bra cpx_e
- cpx_5:
- cmp.b #"Y",(a0)+
- beq cpx_6
- dbf d7,cpx_1
- bra cpx_e
- cpx_6:
- add #1,nibbelcount
- dbf d7,cpx_1
- bra cpx_e
-
- cpx_e:
- cmp #1,nibbelcount
- bmi cpx_e1
- add #1,emptyblocks
- move.b #"X",(a1)
- cpx_e1: lea 1(a1),a1
- add.l #512,a2
- dbf d6,cpx_0
- rts
-
- clicommand:
- move.l clineadd,a0
- move.l clinelen,d0
-
- beq cli_end
- cmp #"df",(a0)+
- bne cli_2
- moveq #0,d0
- move.b (a0)+,d0
- cmp.b #$33,d0
- bhi cli_end
- cmp.b #$30,d0
- bmi cli_end
- move.b d0,dfx
- sub.b #$30,d0
- move.l d0,drive
- add.l #5,clineadd
- sub.l #5,clinelen
- bra cli_3
- cli_2:
- move.l clineadd,a0
- cmp.b #"?",(a0)
- bne cli_3
- move.l #help,tsource
- move.l #(helpe-help),tlaenge
- bsr print
- bra fini
- cli_3:
-
- bsr ascii2dez
-
- cmp #179,d3
- bhi cli_end
- mulu #11,d3
- move d3,curblock
-
- sub.l #1,clinelen
- add.l #1,clineadd
-
-
- cmp.l #0,clinelen
- ble cli_end
- bsr ascii2dez
- cmp #179,d3
- bhi cli_end
- mulu #11,d3
- cmp curblock,d3
- bmi cli_end
- move d3,lasblock
-
-
- cli_end:
- cmp.l #0,clinelen
- beq cli_return
-
- cli_para:
- move.b (a0),parameter
- bra cli_return
-
- ascii2dez:
-
- move.l clineadd,a0
- move.l clinelen,d7
- sub #1,d7
-
- moveq #0,d0
- moveq #0,d1
- moveq #0,d2
- moveq #0,d3
- move.b (a0)+,d0
- cmp.b #$30,d0
- bmi cloop_3
- cmp.b #$39,d0
- bhi cloop_3
- sub.b #$30,d0
- move.b d0,d1
-
- dbra d7,cloop_1
- bra cli_4
- cloop_1:
- sub.l #1,clinelen
- add.l #1,clineadd
- move.b (a0)+,d0
- cmp.b #$30,d0
- bmi cli_4
- cmp.b #$39,d0
- bhi cli_4
- sub.b #$30,d0
- move.b d0,d2
- mulu #10,d1
-
- dbra d7,cloop_2
- bra cli_4
- cloop_2:
-
- sub.l #1,clinelen
- add.l #1,clineadd
- move.b (a0)+,d0
- cmp.b #$30,d0
- bmi cli_4
- cmp.b #$39,d0
- bhi cli_4
- sub.b #$30,d0
- move.b d0,d3
- mulu #10,d1
- mulu #10,d2
-
- cli_4: add d2,d3
- add d1,d3
- cloop_3: rts
-
-
-
-
-
- LoadBlock:
-
-
- lea DiskIO,a1
- move.l #ReplyPort,14(a1) * Nachrichten-Port laden
- move.w #2,28(a1) * Kommando: lesen
- move.l #512*11,36(a1) * Länge: 512 Bytes * track
- move.l #buffer,40(a1) * Adresse
- moveq #0,d0
- move curblock,d0
- asl.l #8,d0
- asl.l #1,d0
- move.l d0,44(a1) * Byte-Offset startblock
- movem.l d1-d3/a1-a3,-(SP)
- CALLEXEC DoIO * und 'reinladen!
- movem.l (SP)+,d1-d3/a1-a3
- move d0,error
- beq return
- errors:
- * cmp.w #29,error
- * bne error_1
- move.l #noDisk,tsource
- move.l #(noDiske-nodisk),tlaenge
- bsr print
- move.l (sp)+,a0
- bra ende
- error_1:
- bra ende
- return:
- rts
-
- normmode:
- lea printbuffer,a0
- move #11-1,d7
- nrmd_2: cmp.b #"1",(a0)
- bne nrmd_1
- nrmd_3: lea 1(a0),a0
- dbf d7,nrmd_2
- rts
- nrmd_1: move.b #".",(a0)
- bra nrmd_3
-
- fillbuffer:
- move.l #"1111",printbuffer
- move.l #"1111",printbuffer+4
- move.l #"111 ",printbuffer+8
- rts
- printfree:
- lea printbuffer,a0
- move.l #"Bloc",(a0)+
- move.l #"ks f",(a0)+
- move.l #"ree ",(a0)+
- move #": ",(a0)+
-
- move emptyblocks,d2
- move emptyblocks,$60000
-
- move d2,d1
- divu #1000,d1
- tst d1
- beq prfr_1
- move.b #"1",(a0)+
- prfr_1: mulu #1000,d1
- sub d1,d2
- move d2,d1
- divu #100,d1
- add.b #$30,d1
- move.b d1,(a0)+
- sub.b #$30,d1
- mulu #100,d1
- prfr_2: sub d1,d2
- move d2,d1
- divu #10,d1
- add.b #$30,d1
- move.b d1,(a0)+
- sub.b #$30,d1
- mulu #10,d1
- prfr_3: sub d1,d2
- move d2,d1
- add.b #$30,d1
- move.b d1,(a0)+
-
-
- move.b #10,(a0)+
-
- move.l #printbuffer,tsource
- move.l #19,tlaenge
- bsr print
- rts
-
- trackprint:
- moveq #0,d0
- move curblock,d0
- beq trpri_0
- trpri_0: divu #11,d0
- lea printbuffer,a0
- move.b #"0",(a0)
- cmp #100,d0
- bmi trpri_1
- move.b #"1",(a0)
- sub #100,d0
- trpri_1:
- lea 1(a0),a0
- move.l d0,d1
- divu #10,d0
- move.b d0,(a0)
- add.b #$30,(a0)+
- mulu #10,d0
- sub d0,d1
- move.b d1,(a0)
- add.b #$30,(a0)+
- move.b #":",(a0)+
- move.b #" ",(a0)+
- move.l #printbuffer,tsource
- move.l #5,tlaenge
- bsr print
- rts
-
- enter: move.l #enterc,tsource
- move.l #1,tlaenge
- bsr print
- rts
-
- Print: move.l DOSBase,a6 ;DOS-Funktion rufen
- jsr _LVOOutput(a6) ;Hole Output-Handle
- move.l d0,d1 ;und in d1 merken
-
- move.l tsource,d2 ;Address Text
- move.l tlaenge,d3 ;Laenge Text
- move.l DOSBase,a6 ;Basis DOS
- jsr _LVOWrite(a6) ;Funktion "Schreiben"
- rts
-
- *********************** Datenbereich **********************************
- nibbelcount: dc.w 0 * Zähler für Dos,Xcopy,bla
- trackcount: dc.w 0 * Zähler für tracks in einer zeile
- emptyblocks: dc.w 0 * anzahl leerer blöcke
- curblock: dc.w 0 * akueller track
- lasblock: dc.w 1749 * letzer track
-
- clineadd: dc.l 0 * cli-command
- clinelen: dc.l 0 * cli-command
- parameter: dc.w 0 * Cli-parameter
-
- error: dc.w 0 * ErrorStatus
- drive: dc.l 0 * DFx (?)
- *********************** Datenbereich **********************************
-
- tsource: dc.l 0
- tlaenge: dc.l 0
- DiskIO: ds.b 80 * IOStdReq-Record
- ReplyPort: ds.b 34 * MsgPort-Record
- DevName: dc.b "trackdisk.device",0
- even
-
- Memory: dc.l 0
-
- DOSBase: dc.l 0
- dosname: dc.b 'dos.library',0
- even
-
- help:
- dc.b "DYTEC-Intern-Release 07/09/92 ",10
- dc.b "Searching: zero-blocks : 0 ",10
- dc.b " DOS & DOW -blocks : D ",10
- dc.b " XCOPY-blocks : X ",10
- dc.b " used block : 1 ",10,10
- dc.b "Usage: Trackcheck [drive] [starttrack] [endtrack]"
- dc.b " [parameter]",10,10
- dc.b "parameter: n - normal mode (default)",10
- dc.b " a - all infos about da block",10
- dc.b " f - only the blocksfreedisplay",10
- dc.b 10,"Test it, but don`t spread it out of Dytec!",10
-
- helpe: even
-
- text1: dc.b $1B,$5B,$31,$6D,"Track-Checker "
- dc.b $1B,$5B,$3b,$6D,"V1.00 by Grain/Dytec",10
- text1e: even
- search dc.b "is now searching for empty Blocks in DF"
- dfx: dc.b "0:",10
- searche: even
- noDisk: dc.b "No Disk in Drive!",10
- noDiske: even
- noDrive: dc.b "Drive not found!",10
- noDrivee: even
- nul: dc.b "0"
- even
- one: dc.b "1"
- even
- next: dc.b "."
- even
- enterc: dc.b 10
- even
-
-
- section sectors,bss_p
- printbuffer: ds.b 100
- buffer: ds.b 512*11 * Trackbuffer
- blk0: ds.b 512
- blk1: ds.b 512
-
-