Technical information

Serial Solutions Aterm
inst02:
ret ;done
inpstr endp
;
The read is performed by DOS service 03FH, read handle,
to read bytes into a buffer in ATERM’s memory (xiobuf). It is
at the first access of the port for a read or write that the driver
itself is actually accessed. It sets up its internal buffers, which
are essential for interrupt driven I/O, and initialises the serial
hardware. Service 03FH returns the number of bytes read.
Inpstr() also handles echo to line, by calling outstr(), the serial
output function.
Writing To The File.__________________
Writes to the serial port are performed by outstr, below.
Figure 8-4. Subroutine Outstr.___________________________
;********************************************************************
;* *
;* Outstr- sends characters from xiobuf to serial port. *
;* Reports error to user if this fails. The routine *
;* returns anyway. *
;********************************************************************
; On entry
; CX = number bytes to send
; Segment registers as start proc
; xiobuf = characters to be sent
;
; On exit
; AX undefined
; BX undefined
; CX undefined
; DX undefined
; xiobuf unaffected
;
; Flags undefined
; All other regs unaffected.
; Stack useage- as DOS service 40H
;
outstr proc near
mov ah,40H ;DOS write handle
mov bx, comport ;File handle
mov dx,offset xiobuf ;Where data
int dos
Page 134 Chapter 8