home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-386-Vol-2of3.iso
/
b
/
batdoor.zip
/
PAUSE_R.ZIP
/
PAUSE_R.ASM
next >
Wrap
Assembly Source File
|
1986-11-21
|
3KB
|
83 lines
;
; PAUSE_R: A remote PAUSE for DOORS users.
;
; Courtesy of: The BBS of Excellence (312)398-2872
;
; To make this program work under COM2: change the constants as
; indicated.
;
cseg segment byte public 'CODE'
assume cs:cseg,ds:cseg,es:cseg
org 100h
Pause_r proc near
jmp MainCode ; Skip over constant
;
LineReg dw 3FDh ; for COM1: 2FDh = COM2:
DataReg dw 3F8h ; for COM1: 2F8h = COM2:
;
MainCode:
Call WriteMsg ; If a message exists, then output it
Call Wait ; Go wait for an input
Int 20h ; Terminate program
Pause_r endp
WriteMsg Proc Near
mov SI,80h ; point to the command buffer
Xor CX,CX ; Init the loop counter
Mov CL,[SI] ; Get the input length
Cmp CL,0 ; Was there no input ?
JZ ExitWrite ; True...then just wait
Inc SI ; Point past the length
WriteLoop:
Mov AH,2 ; Indicate screen write
Inc SI ; Point to next character
Mov DL,[SI] ; Get the character
Cmp DL,'|' ; Is this an Esc character ?
Jne WriteScreen ; No...continue
Mov DL,27 ; Change to a REAL Esc character
WriteScreen:
Int 21h ; Write character to the screen
Mov AL,[SI] ; Get the character
Cmp AL,'@' ; Is it an Esc request ?
Jne WriteCom ; No...continue
Mov AL,27 ; Change to a REAL Esc character
WriteCom:
Push AX ; Save the byte
WaitLineLoop:
Mov DX,LineReg ; Get the Line Register address xFDh
In AL,DX ; Get the Line status
And AL,20h ; Is the Xmit buffer empty ?
Cmp AL,20h ; Is it?
Jne WaitLineLoop ; No...Exit to caller
Pop AX ; Restore the byte
Mov DX,DataReg ; Point to output port
Out DX,AL ; Output the character
Loop WriteLoop ; Keep doing it until no more
ExitWrite:
Ret ; Return to main routine
WriteMsg Endp
Wait Proc Near
Read_Byte_Wait:
Mov DX,LineReg ; Get the Line Register address xFDh
In AL,DX ; Get the Line status
And AL,01h ; Isolate data ready bit
Cmp AL,01h ; Is there data ready
Jz Get_Remote_Byte ; Yes...clear buffer and exit
Mov AH,1 ; Set up status command
Int 16h ; Has a local key been pressed ?
Jz Read_Byte_Wait ; No...keep on waiting
Xor AH,AH ; Set up read command
Int 16h ; clear the buffer
Jmp Wait_Exit ; Return to caller
Get_Remote_Byte:
Mov DX,DataReg ; Point to the data register
In AL,DX ; Get the data byte
Wait_Exit:
Ret ; Return to main routine
Wait Endp
CSEG Ends
End Pause_r