home *** CD-ROM | disk | FTP | other *** search
- ; Time cruncher version AMIGA v1.0
-
- start = $30000
- write = $40000
- stop = $32000
- offset = $fff0
-
- s:
- lea start,a0
- lea stop,a1
- lea write,a2
- moveq #1,d2
- clr.l d1
-
- noteocrunch:
- bsr.S crunch
-
- beq.S crunched
- addq.l #1,d1
-
- crunched:
- cmp.l a0,a1
- bgt.S noteocrunch
-
- bsr.L dojmp
-
- bsr.L write1lwd
-
- lea start,a0
- lea stop,a1
- move.l a1,d2
- sub.l a0,d2
- move.l d2,(a2)+
-
- clr.l d0
- clr.l d1
- clr.l d2
- clr.l d3
- clr.l d4
- clr.l d5
- lea cnt,a3
- movem.w (a3)+,d0-d5
- move.l a2,a3
- sub.l a0,a3
- lea stop,a4
- sub.l a2,a4
- rts
-
- crunch:
- move.l a0,a3
- add.l #offset,a3
- cmp.l a1,a3
- ble.S nottop
- move.l a1,a3
-
- nottop:
- moveq #$1,d5
- move.l a0,a5
- addq.l #$1,a5
-
- contcrunch:
-
- move.b (a0),d3
- move.b $1(a0),d4
-
- quickfind:
- cmp.b (a5)+,d3
- beq.S find2
-
- contfind:
- cmp.l a5,a3
- bgt.S quickfind
- bra.S endquickfind
-
- find2: cmp.b (a5),d4
- bne.S contfind
-
- lenfind:
- subq.l #1,a5
- move.l a0,a4
-
- scan:
- cmpm.b (a5)+,(a4)+
- bne.S endequ
- cmp.l a5,a3
- bgt.S scan
-
- endequ:
- move.l a4,d3
- sub.l a0,d3
- subq.l #1,d3
- cmp.l d3,d5
- bge.S nocrunch
-
- move.l a5,d4
- sub.l a0,d4
- sub.l d3,d4
- subq #1,d4
-
- cmp.l #$3,d3
- ble.S small
-
- moveq #$4,d6
- cmp.l #$00000100,d3
- blt.S cont1
- move.l #$ff,d3
-
- oksafe:
- bra.S cont1
-
- small:
- move.w d3,d6
- subq.w #$2,d6
- lsl.w #1,d6
-
- cont1:
- lea table,a6
- cmp.w (a6,d6.w),d4
- bhi.S nocrunch
- move.l d3,d5
- move.l d4,maxsoffset
- move.b d6,tbloffset
-
- nocrunch:
- cmp.l a5,a3
- bgt.S contcrunch
-
- endquickfind:
- cmp.l #$1,d5
- beq.L nothingfound
-
- bsr.L dojmp
-
- move.b tbloffset,d6
- move.l maxsoffset,d3
- moveq #8,d0
- cmp.w #$0,d6
- beq.S smalloff
- cmp.w #$2,d6
- beq.S midoff
-
- bigoff:
- moveq #17,d0
- cmp.w #$0fff,d3
- bhi.S woffset
- cmp.w #$0100,d3
- bge.S bigoff1
- moveq #10,d0
- or.w #$0300,d3
- bra.S woffset
-
- bigoff1:
- moveq #14,d0
- or.w #$2000,d3
- bra.S woffset
-
- midoff:
- moveq #15,d0
- cmp.w #$0100,d3
- bge.S woffset
- moveq #9,d0
- or.w #$0100,d3
-
- smalloff:
- woffset:
- bsr.L wd0bits
-
- cmp.w #$4,d5
- ble.S nolength
- move.l d5,d3
- moveq #8,d0
- cmp.w #11,d3
- bge.S wlength
- moveq #1,d0
- sub.w #7,d3
- bmi.S wlength
- moveq #2,d0
-
- wlength:
- bsr.L wd0bits
-
- nolength:
- moveq #2,d0
- move.w d5,d3
- subq.w #2,d3
- cmp.w #4,d5
- ble.S wcode
-
- moveq #3,d0
- moveq #6,d3
- cmp.w #6,d5
- ble.S wcode
-
- moveq #4,d0
- moveq #14,d3
- cmp.w #10,d5
- ble.S wcode
-
- moveq #15,d3
-
- wcode:
- bsr.L wd0bits
- addi.w #$1,40(a6,d6.w)
- bchg #1,$bfe001
- add.l d5,a0
- clr.b d0
- rts
-
- nothingfound:
- move.b (a0)+,d3
- moveq #$8,d0
- bsr.L wd0bits
- moveq #$1,d0
- rts
-
- maxsoffset: dc.l 0
- tbloffset: dc.w 0
-
- table:
- offst: dc.w $00ff,$3fff,$fff0,$0000
- lnoff: dc.w $0008,$ffff,$ffff,$0000
- length: dc.w $0000,$0000,$ffff,$0000
- cdlen: dc.w $0002,$0002,$0001,$0000
- code: dc.w $0000,$0001,$0001,$0000
- cnt: dc.w $0,$0,$0,$0
- cntjmp: dc.w $0,$0,$0,$0
-
-
- dojmp:
- move.l d1,d3
- clr.l d1
- cmp.l #$400,d3
- bge.S bigjmp3
- cmp.w #$17,d3
- bge.S bigjmp2
- cmp.w #7,d3
- bge.S bigjmp1
- addq.w #1,cntjmp
- moveq #3,d0
- bra.S wd0bits
-
- bigjmp1:
- addq.w #1,cntjmp+2
- subi.w #7,d3
- or.w #$e0,d3
- moveq #8,d0
- bra.S wd0bits
-
- bigjmp2:
- addq.w #1,cntjmp+4
- or.w #$3c00,d3
- moveq #14,d0
- bra.S wd0bits
-
- bigjmp3:
- addq.w #1,cntjmp+6
- or.l #$f0000000,d3
- moveq #32,d0
-
- wd0bits:
- subq.w #1,d0
-
- copybits:
- lsr.l #1,d3
- roxl.l #1,d2
- bcs.S writelwd
- dbf d0,copybits
- rts
-
- write1lwd:
- clr.w d0
-
- writelwd:
- move.l d2,(a2)+
- moveq #1,d2
- dbf d0,copybits
- rts
-
- END
-
- ;This cruncher is written by PHS of CCS
-
- ;Hakan Sundell
- ;C. C. S.
- ;Sweden
-
- ;This cruncher is much better than bytekiller v1.2,but slower!