home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c010 / 1.ddi / FLILIB3.ZIP / FLISRC3.ZIP / UNBRUN.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-08-29  |  1.3 KB  |  71 lines

  1. ;fii_unbrun.asm - low level routine to uncompress 1st frame of a FLI
  2.  
  3.     TITLE    ubrun
  4.  
  5.     dosseg
  6.     .model    large
  7.     .code
  8.  
  9.     PUBLIC _fii_unbrun
  10.     ;fii_unbrun_(cbuf, screen, linect)
  11. _fii_unbrun PROC far
  12. linect equ word ptr[bp+12+2]
  13.     ;save the world and set the basepage
  14.     push bp
  15.     mov bp,sp
  16.     sub sp,4
  17.     push es
  18.     push ds
  19.     push si
  20.     push di
  21.     push bx
  22.     push cx
  23.  
  24.     cld    ;clear direction flag in case Aztec or someone mucks with it.
  25.  
  26.     lds si,[bp+4+2]
  27.     les di,[bp+8+2]
  28.     mov    dx,di    ;keep pointer to start of line in dx
  29.     xor    ah,ah    ;clear hi bit of ah cause lots of unsigned uses to follow
  30. linelp:
  31.     mov    di,dx
  32.     lodsb        ;get op count for this line
  33.     mov bl,al  
  34.     test bl,bl
  35.     jmp endulcloop
  36. ulcloop:
  37.     lodsb    ; load op/count
  38.     test al,al
  39.     js ucopy
  40.     mov cx,ax ;move count to cx
  41.     lodsb      ;value to repeat in al
  42.     rep stosb ;store same value again and again...
  43.     dec bl      ;through with this line yet????
  44.     jnz ulcloop
  45.     jmp ulcout
  46. ucopy:
  47.     neg al
  48.     mov cx,ax ;get sign  correctec copy count
  49.     rep movsb 
  50.     dec bl
  51. endulcloop:
  52.     jnz ulcloop
  53. ulcout:         ;advance to next line...
  54.     add    dx,320
  55.     dec linect
  56.     jnz    linelp
  57.  
  58.     pop cx
  59.     pop bx
  60.     pop di
  61.     pop si
  62.     pop ds
  63.     pop es
  64.     mov    sp,bp
  65.     pop    bp
  66.     ret    
  67.  
  68. _fii_unbrun ENDP
  69.  
  70. END
  71.