Category : Assembly Language Source Code
Archive   : ASM_SUBR.ZIP
Filename : COMINCK

 
Output of file : COMINCK contained in archive : ASM_SUBR.ZIP
;-------------------------cominck routine begins--------------------------+
; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
; page : 35
;
; NAME COMINCK
; ROUTINE FOR COMMUNICATIONS LINE INPUT CHECK
;
; FUNCTION: This routine checks but does not wait for input from one of
; the two serial communications lines.
; INPUT: Upon entry DX contains the unit number (0 for comm1: and 1 for
; comm2:). During the routine, input is from the specified communications
; line.
; OUTPUT: If a byte is available, the routine returns with the flag
; condition NZ and the byte in AL. If no byte is available then the
; routine returns with the flag condition Z and AL is meaningless.
; REGISTERS USED: AH is modified.. DX is used for input and AL is used
; for output.
; SEGMENTS REFERENCED: During the routine the system data segment is
; referenced.
; ROUTINES CALLED: None
; SPECIAL NOTES: None
;
; ROUTINE TO CHECK FOR INPUT FROM A COMMUNICATIONS LINE
;
cominck proc far
;
push ds ; save registers
push dx
push si
;
mov si,dx ; look up address of comm line
add si,si ; double to index into table
mov dx,40h ; segment of table
mov ds,dx ; set data segment to this table
mov dx,[si] ; now get it
add dx,5 ; line status
in al,dx ; get it
test al,1 ; receive buffer full ?
jz cominckexit ; yes, it is
;
mov dx,[si] ; data register
in al,dx ; get data
;
cominckexit:
;
pop si ; restore registers
pop dx
pop ds
;
ret ; return
;
cominck endp
;-------------------------cominck routine ends---------------------------+


  3 Responses to “Category : Assembly Language Source Code
Archive   : ASM_SUBR.ZIP
Filename : COMINCK

  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/