Category : Utilities for DOS and Windows Machines
Archive   : HISTORY.ZIP
Filename : SETUP.ASM

 
Output of file : SETUP.ASM contained in archive : HISTORY.ZIP
dataseg segment para public 'data'
extrn lineoff_:word,lineseg_:word
extrn $MEMRY:word
pgmstack dw ?
dataseg ends

codeseg segment para public 'code'

public setup_
extrn getline_:near

old21 dd ?
holdax dw ?
holdss dw ?
holdsp dw ?
holdds dw ?

setup_ proc near
assume cs:codeseg,ds:dataseg
mov dx,$MEMRY
add dx,10fh
and dl,0fff0h
mov pgmstack,dx

mov ax,3521h ;save old interrupt 21 vector
int 21h
mov word ptr old21,bx
mov ax,es
mov word ptr old21+2,ax

mov ax,2521h ;set new interrupt vector
mov dx,offset ngbuf
int 21h

mov dx,pgmstack
mov cl,4
shr dx,cl
mov ax,3100h ;terminate and stay resident
int 21h
setup_ endp

ngbuf proc far
pushf
cmp ah,0ah ;buffered input?
jz ngbuf1
popf
jmp old21

ngbuf1: mov cs:holdax,ax
mov cs:holdss,ss
mov cs:holdsp,sp
mov cs:holdds,ds

mov ax,cs ;set up ds
mov ds,ax

cli ;no ints while messing with stack
mov ss,ax
mov sp,pgmstack
sti ;ok, now you can interrupt

push bx ;save regs
push cx
push dx
push si
push di
push bp
push es

mov ax,holdds ;set up for getline
mov lineseg_,ax
mov lineoff_,dx
call getline_

pop es
pop bp
pop di
pop si
pop dx
pop cx
pop bx

cli ;no interruptions please
mov ss,cs:holdss
mov sp,cs:holdsp
sti ;ok to interrupt again

mov ds,cs:holdds
mov ax,cs:holdax
popf

iret

ngbuf endp

codeseg ends

end


  3 Responses to “Category : Utilities for DOS and Windows Machines
Archive   : HISTORY.ZIP
Filename : SETUP.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/