home *** CD-ROM | disk | FTP | other *** search
/ Graphics 16,000 / graphics-16000.iso / msdos / animutil / flilib / flisrc / unlccomp.asm < prev    next >
Assembly Source File  |  1989-11-10  |  1KB  |  77 lines

  1.  
  2. _TEXT    SEGMENT  BYTE PUBLIC 'CODE'
  3.  
  4.     ASSUME  CS: _TEXT 
  5.  
  6.     PUBLIC _fii_unlccomp
  7.     ;fii_unlccomp_(cbuf, screen)
  8. _fii_unlccomp PROC far
  9. linect equ word ptr[bp-2]
  10.     ;save the world and set the basepage
  11.     push bp
  12.     mov bp,sp
  13.     sub sp,4
  14.     push es
  15.     push ds
  16.     push si
  17.     push di
  18.     push bx
  19.     push cx
  20.  
  21.     cld    ;clear direction flag in case Aztec or someone mucks with it.
  22.  
  23.     lds si,[bp+4+2]
  24.     les di,[bp+8+2]
  25.     lodsw    ;get the count of # of lines to skip
  26.     mov dx,320
  27.     mul dx
  28.     add di,ax
  29.     lodsw        ;get line count
  30.     mov    linect,ax    ;save it on stack
  31.     mov    dx,di    ;keep pointer to start of line in dx
  32.     xor    ah,ah    ;clear hi bit of ah cause lots of unsigned uses to follow
  33. linelp:
  34.     mov    di,dx
  35.     lodsb        ;get op count for this line
  36.     mov bl,al  
  37.     test bl,bl
  38.     jmp endulcloop
  39. ulcloop:
  40.     lodsb    ;load in the byte skip
  41.     add di,ax
  42.     lodsb    ; load op/count
  43.     test al,al
  44.     js ulcrun
  45.     mov cx,ax
  46.     rep movsb
  47.     dec bl
  48.     jnz ulcloop
  49.     jmp ulcout
  50. ulcrun:
  51.     neg al
  52.     mov cx,ax ;get signed count
  53.     lodsb      ;value to repeat in al
  54.     rep stosb
  55.     dec bl
  56. endulcloop:
  57.     jnz ulcloop
  58. ulcout:
  59.     add    dx,320
  60.     dec linect
  61.     jnz    linelp
  62.  
  63.     pop cx
  64.     pop bx
  65.     pop di
  66.     pop si
  67.     pop ds
  68.     pop es
  69.     mov    sp,bp
  70.     pop    bp
  71.     ret    
  72.  
  73. _fii_unlccomp ENDP
  74.  
  75. _TEXT    ENDS
  76. END
  77.