home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / asm_subr.arc / COMOFF < prev    next >
Encoding:
Text File  |  1985-12-15  |  1.4 KB  |  43 lines

  1. ;-------------------------comoff routine begins--------------------------+
  2. ; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
  3. ;         page : 38
  4. ;
  5. ; NAME COMOFF
  6. ; ROUTINE FOR COMMUNICATIONS LINE OFF
  7. ;
  8. ; FUNCTION: This routine turns off the handshaking signal DTR (line 20)
  9. ; on the specified communications line.  RTS (line 4) is kept as it was.
  10. ; INPUT: Upon entry DX contains the unit number (0 for comm1: and 1 for
  11. ; comm2:).
  12. ; OUTPUT: Just to the communications line.
  13. ; REGISTERS USED:  No registers modified.  DX is used for input.
  14. ; SEGMENTS REFERENCED:  During the routine the system data segment is
  15. ; referenced.
  16. ; ROUTINES CALLED:  None
  17. ; SPECIAL NOTES: None
  18. ;
  19. ; ROUTINE TO TURN OFF INPUT FROM A COMMUNICATIONS LINE
  20. ;
  21. comoff    proc    far
  22. ;
  23.     push    ds        ; save registers
  24.     push    dx
  25.     push    si
  26. ;
  27.     mov    si,dx        ; look up address of comm line
  28.     add     si,si        ; double to index into table
  29.     mov    dx,40h        ; segment of system I/O table
  30.     mov    ds,dx        ; set data segment to this table
  31.     mov    dx,[si]        ; look up data
  32.     add    dx,4        ; modem control register
  33.     mov    al,2        ; clear DTR (line 20)
  34.     out    dx,al        ; send out control byte
  35. ;
  36.     pop    si        ; restore registers
  37.     pop    dx
  38.     pop    ds
  39.     ret            ; return
  40. ;
  41. comoff    endp
  42. ;-------------------------comoff routine ends---------------------------+
  43.