home *** CD-ROM | disk | FTP | other *** search
/ PC World 1997 November / PCWorld_1997-11_cd.bin / software / sharware / utility / PACKERS / LZH / LHASRC.EXE / DSPMRK_.ASM < prev    next >
Assembly Source File  |  1991-02-11  |  1KB  |  78 lines

  1. ;***********************************************
  2. ;    dspmrk_.asm -- displays indicator marks
  3. ;***********************************************
  4.             page    0, 128
  5.  
  6. include    amscls.inc
  7. $_init    GEN
  8.  
  9. CGROUP    GROUP    TEXT
  10. DGROUP    GROUP    DATA,BSS
  11.         assume    cs:CGROUP, ds:DGROUP, ss:DGROUP
  12.  
  13. TEXT    segment byte public 'CODE'
  14. TEXT    ends
  15.  
  16. DATA    segment byte public 'DATA'
  17. DATA    ends
  18.  
  19. BSS        segment byte public 'DATA'
  20. mark    db        1 dup (?)
  21. BSS        ends
  22.  
  23. extrn    maxblk_:word
  24. extrn    blkcnt_:word
  25. extrn    curcnt_:word
  26. extrn    nxtcnt_:word
  27.  
  28. TEXT    segment byte public 'CODE'
  29.             public    initdisp_
  30. initdisp_    proc    near
  31.     xor        ax, ax
  32.     mov        curcnt_, ax
  33.     $_if <cmp blkcnt_, -1>, E
  34.         dec        ax
  35.     $_endif
  36.     mov        nxtcnt_, ax
  37.     ret
  38. initdisp_    endp
  39.  
  40.             public    dispmark_
  41. dispmark_    proc    near
  42.     mov        mark, al
  43.     mov        ax, DGROUP:curcnt_
  44.     inc        DGROUP:curcnt_
  45.     $_if <cmp ax, DGROUP:nxtcnt_>, AE
  46.         push    dx
  47.         push    cx
  48.         push    ax
  49.         mov        ah, 40h            ; output char to stderr
  50.         mov        bx, 2
  51.         mov        cx, 1
  52.         mov        dx, offset DGROUP:mark
  53.         int        21h
  54.         pop        ax
  55.         mov        cx, DGROUP:maxblk_
  56.         $_if <cmp DGROUP:blkcnt_, cx>, A
  57.             mul        cx                    ; calculation of next blk
  58.             mov        bx, DGROUP:blkcnt_
  59.             dec        bx
  60.             add        ax, bx
  61.             adc        dx, 0
  62.             inc        bx
  63.             div        bx
  64.             inc        ax
  65.             mul        bx
  66.             div        cx
  67.         $_else
  68.             inc        ax
  69.         $_endif
  70.         mov        DGROUP:nxtcnt_, ax
  71.         pop        cx
  72.         pop        dx
  73.     $_endif
  74. dispmark_    endp
  75.     ret
  76. TEXT    ends
  77.         end
  78.