home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Assembler / dse-src6.dms / in.adf / BOUNCHSRCS.LZH / TDC.S < prev    next >
Encoding:
Text File  |  1986-12-07  |  2.3 KB  |  165 lines

  1. ; Timedecruncher AMIGA v1.0 by PHS of CCS
  2.  
  3. read  = $5c6d4 ; This is the end address of the crunched file
  4. lowwr = $30000 ; This is the start adress of the uncrunched file
  5.  
  6. start:
  7.     lea    read,a0
  8.     lea    lowwr,a1        
  9.     move.l    -(a0),a2        
  10.     add.l    a1,a2        
  11.     move.l    -(a0),d0        
  12.  
  13. notfinished:
  14.     moveq    #3,d1
  15.     bsr.L    rdd1bits    
  16.     tst.b    d2
  17.     beq.S    nextcmd1
  18.     cmp.w    #$7,d2
  19.     bne.S    smalljmp
  20.     lsr.l    #1,d0
  21.     bne.S    notempty1
  22.     bsr.L    getnextlwd
  23. notempty1:
  24.     bcc.S    midjmp
  25.     moveq    #10,d1
  26.     bsr.L    rdd1bits
  27.     tst.w    d2
  28.     bne.S    smalljmp
  29.     moveq    #18,d1
  30.     bsr.L    rdd1bits
  31.     bra.S    smalljmp
  32. midjmp:
  33.     moveq    #4,d1
  34.     bsr.L    rdd1bits
  35.     addq.w    #7,d2
  36.     
  37. smalljmp:
  38.     subq.w    #1,d2
  39. getd2chr:
  40.     moveq    #7,d1    
  41.  
  42. get8bits:
  43.     lsr.l    #1,d0
  44.     beq.S    empty3
  45.     roxl.l    #1,d3
  46.     dbf    d1,get8bits
  47.     move.b    d3,-(a2)
  48.     dbf    d2,getd2chr
  49.     bra.S    nextcmd1
  50. empty3:
  51.     move.l    -(a0),d0
  52.     move.w    #$10,ccr
  53.     roxr.l    #1,d0
  54.     roxl.l    #1,d3
  55.     dbf    d1,get8bits
  56.     move.b    d3,-(a2)
  57.     dbf    d2,getd2chr    
  58.  
  59. nextcmd1:
  60.     cmp.l    a2,a1
  61.     bge.S    end
  62.  
  63. cmd2:
  64.     moveq    #2,d1
  65.     bsr.L    rdd1bits
  66.     moveq    #2,d3
  67.     moveq    #8,d1
  68.     tst.w    d2
  69.     beq.S    dodupl
  70.     moveq    #4,d3
  71.     cmp.w    #%10,d2
  72.     beq.S    bigoff
  73.     moveq    #3,d3
  74.     cmp.w    #%01,d2
  75.     beq.S    smalloff
  76.     moveq    #2,d1
  77.     bsr.S    rdd1bits
  78.     cmp.w    #3,d2
  79.     beq.S    biglength
  80.     cmp.w    #%10,d2
  81.     beq.S    sevlength
  82.     addq.w    #5,d2
  83.     move.w    d2,d3
  84.     bra.S    bigoff
  85. sevlength:
  86.     moveq    #2,d1
  87.     bsr.S    rdd1bits
  88.     addq.w    #7,d2
  89.     move.w    d2,d3
  90.     bra.S    bigoff
  91. biglength:
  92.     moveq    #8,d1
  93.     bsr.S    rdd1bits
  94.     move.w    d2,d3
  95.     bra.S    bigoff        
  96. smalloff:
  97.     moveq    #8,d1
  98.     lsr.l    #1,d0
  99.     bne.S    notempty2
  100.     bsr.S    getnextlwd
  101. notempty2:
  102.     bcs.S    dodupl
  103.     moveq    #14,d1
  104.     bra.S    dodupl
  105. bigoff:
  106.     moveq    #16,d1
  107.     lsr.l    #1,d0
  108.     bne.S    notempty3
  109.     bsr.S    getnextlwd
  110. notempty3:
  111.     bcc.S    dodupl
  112.     moveq    #8,d1
  113.     lsr.l    #1,d0
  114.     bne.S    notempty4
  115.     bsr.S    getnextlwd
  116. notempty4:
  117.     bcs.S    dodupl
  118.     moveq    #12,d1
  119.  
  120. dodupl:
  121.     bsr.S    rdd1bits
  122.     subq    #1,d3        
  123.  
  124. copynextbyte:
  125.     move.b    -1(a2,d2.L),-(a2)
  126.     dbf    d3,copynextbyte
  127.  
  128. nextcmd2:
  129.     bra.L    notfinished
  130. end:
  131.     rts
  132.  
  133. getnextlwd:
  134.     move.l    -(a0),d0
  135.     move.w    #$10,ccr
  136.     roxr.l    #1,d0
  137.     rts
  138.  
  139. rdd1bits:
  140.     subq.w    #1,d1
  141.     clr.l    d2
  142.  
  143. getbits:
  144.     lsr.l    #1,d0
  145.     beq.S    empty
  146.     roxl.l    #1,d2
  147.     dbf    d1,getbits
  148.     rts
  149.  
  150. empty:
  151.     move.l    -(a0),d0
  152.     move.w    #$10,ccr
  153.     roxr.l    #1,d0
  154.     roxl.l    #1,d2
  155.     dbf    d1,getbits
  156.     rts
  157.  
  158. ;Written by PHS of CCS
  159.  
  160. ;Hakan Sundell
  161. ;C. C. S.
  162. ;Sweden
  163.  
  164. ;This cruncher is much better than bytekiller v1.2,and faster!
  165.