Technical information
Aterm Serial Solutions
jnc outs01 ;Data sent ok
mov ax,fromctrl ;Flag source of output
mov bx,offset writefail
call screen ;Display error message
outs01:
ret
outstr endp
The DOS function 040H is used to write characters to the
serial port. This returns carry set if there was some problem in
sending data out. Such errors are tested by outstr, as above.
Closing The File._______________
The subroutine close_com is used to close the file, below.
Figure 8-5. Subroutine Close_com.______________________________
;********************************************************************
;* *
;* Close_com-attempts to close file comport. Sets file *
;* handles to -1. *
;********************************************************************
;
; On entry
; Segment registers as start proc
; Other regs undefined
; variable comport = handle associated with serial port
;
; On exit
; AX undefined
; BX undefined
;
; Flags undefined
; All other regs unaffected.
; comport = -1
; Stack useage-as DOS functions 3EH
;
close_com proc near
mov bx,comport
cmp bx,-1 ;-1 means not set
je clsp01
mov ah,3EH ;DOS close handle
int dos
mov comport,-1 ;Set unset status
Chapter 8 Page 135