home *** CD-ROM | disk | FTP | other *** search
- ;***********************************************
- ; dspmrk_.asm -- displays indicator marks
- ;***********************************************
- page 0, 128
-
- include amscls.inc
- $_init GEN
-
- CGROUP GROUP TEXT
- DGROUP GROUP DATA,BSS
- assume cs:CGROUP, ds:DGROUP, ss:DGROUP
-
- TEXT segment byte public 'CODE'
- TEXT ends
-
- DATA segment byte public 'DATA'
- DATA ends
-
- BSS segment byte public 'DATA'
- mark db 1 dup (?)
- BSS ends
-
- extrn maxblk_:word
- extrn blkcnt_:word
- extrn curcnt_:word
- extrn nxtcnt_:word
-
- TEXT segment byte public 'CODE'
- public initdisp_
- initdisp_ proc near
- xor ax, ax
- mov curcnt_, ax
- $_if <cmp blkcnt_, -1>, E
- dec ax
- $_endif
- mov nxtcnt_, ax
- ret
- initdisp_ endp
-
- public dispmark_
- dispmark_ proc near
- mov mark, al
- mov ax, DGROUP:curcnt_
- inc DGROUP:curcnt_
- $_if <cmp ax, DGROUP:nxtcnt_>, AE
- push dx
- push cx
- push ax
- mov ah, 40h ; output char to stderr
- mov bx, 2
- mov cx, 1
- mov dx, offset DGROUP:mark
- int 21h
- pop ax
- mov cx, DGROUP:maxblk_
- $_if <cmp DGROUP:blkcnt_, cx>, A
- mul cx ; calculation of next blk
- mov bx, DGROUP:blkcnt_
- dec bx
- add ax, bx
- adc dx, 0
- inc bx
- div bx
- inc ax
- mul bx
- div cx
- $_else
- inc ax
- $_endif
- mov DGROUP:nxtcnt_, ax
- pop cx
- pop dx
- $_endif
- dispmark_ endp
- ret
- TEXT ends
- end
-