Category : C Source Code
Archive   : TC_HERC.ZIP
Filename : GLINR.ASM

 
Output of file : GLINR.ASM contained in archive : TC_HERC.ZIP
; C CALLABLE GRAPH LINE RESET FUNCTION
; void glinr(intx1, inty1, intx2, inty2);

name glinr

extrn _gmask:byte, _gaddr:word, _gmap:near
public _glinr

DGROUP group _DATA
assume ds:DGROUP

_DATA segment word public 'DATA'
gx1 dw 0
gy1 dw 0
temp1 db 0
temp2 db 0
_DATA ends

_TEXT segment byte public 'CODE'
assume cs:_TEXT

_glinr proc near
push bp
mov bp, sp
push es
push di
push si
call glin2
pop si
pop di
pop es
mov sp, bp
pop bp
ret
_glinr endp

glin2 proc near
push [bp+6]
push [bp+4]
call _gmap
pop gx1
pop gy1
mov cx, [bp+8]
mov dx, [bp+10]

glin4 proc near
mov ax,0b800h
mov es,ax
cmp gx1,cx
jnz short hg654
call vrtln
ret

hg654: cmp gy1,dx
jnz short diagln
call hrzln
ret
diagln: mov Byte Ptr temp2,01
sub dx, gy1
jns short hg675
neg Byte Ptr temp2
neg dx
hg675: mov Byte Ptr temp1,01
sub cx, gx1
jns short hg689
neg Byte Ptr temp1
neg cx
hg689: mov al, _gmask
mov bx, _gaddr
mov si,cx
cmp cx,dx
jnb short hg69a
mov si,dx
hg69a: inc si
mov di,0
jmp short hg6f3
hg6a1: cmp di,0
jl short hg6d0
sub di,dx
cmp Byte Ptr temp1,0
jl short hg6bf
test al,01
jz short hg6ba
mov al,80h
inc bx
jmp short hg6cb
hg6ba: shr al,1
jmp short hg6cb
hg6bf: test al,80h
jz short hg6c9
mov al,01
dec bx
jmp short hg6cb
hg6c9: shl al,1
hg6cb: cmp di,0
jge short hg6f3
hg6d0: add di,cx
cmp Byte Ptr temp2,0
jl short hg6e8
add bh,20h
jns short hg6f3
and bh,7fh
add bx,5ah
jmp short hg6f3
hg6e8: sub bh,20h
jge short hg6f3
and bh,7fh
sub bx,5ah
hg6f3: not al
and es:[bx],al
not al
dec si
jnz short hg6a1
ret
glin4 endp
glin2 endp

hrzln proc near
mov al, _gmask
mov bx, _gaddr
sub cx, gx1
js short hg5cd
inc cx
jmp short hg5b9
hg5ad: test al,01
jz short hg5b7
mov al,80h
inc bx
jmp short hg5b9
hg5b7: shr al,1
hg5b9: not al
and es:[bx],al
not al
loop hg5ad
ret
hg5cd: neg cx
inc cx
jmp short hg5df
hg5d3: test al,80h
jz short hg5dd
mov al,01
dec bx
jmp short hg5df
hg5dd: shl al,1
hg5df: not al
and es:[bx],al
not al
loop hg5d3
ret
hrzln endp

vrtln proc near
mov al, _gmask
mov bx, _gaddr
sub dx, gy1
js short hg618
inc dx
mov cx,dx
jmp short hg608
hg5fd: add bh,20h
jns short hg608
and bh,7fh
add bx,5ah
hg608: not al
and es:[bx],al
not al
loop hg5fd
ret
hg618: neg dx
inc dx
mov cx,dx
jmp short hg62b
hg620: sub bh,20h
jns short hg62b
and bh,7fh
sub bx,5ah
hg62b: not al
and es:[bx], al
not al
loop hg620
ret

vrtln endp

_TEXT ends
end




  3 Responses to “Category : C Source Code
Archive   : TC_HERC.ZIP
Filename : GLINR.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/