Technical information

Aterm Serial Solutions
Figure 8-3. Subroutine Inpstr.__________________________
;********************************************************************
;* *
;* Inpstr- attempts to read a character from the serial *
;* port if echo to line is set then echo character back *
;* to port. Character is written to xiobuf. *
;* *
;********************************************************************
; On entry
;
; Segment registers as start proc
;
; On exit
;
; Carry = true ==> character has been read
; Carry = false ==> no character read
;
; AX undefined
; BX undefined
; CX undefined
; DX undefined
; xiobuf = character read
;
; Other lags undefined
; All other regs unaffected.
; Stack useage-DOS service 3FH (and outstr if echoed)
;
inpstr proc near
mov ah,3FH ;DOS read file handle
mov bx,comport ;File handle
mov cx,1 ;Read 1 character
mov dx,offset xiobuf ;Where to store it
int dos
cmp ax,1 ;Number read
jne inst01 ;None read
mov ax,echo ;Check echo
and ax,echol
jz inst03 ;No echo
;echo
mov cx,1 ;1 character
call outstr ;send it
inst03:
stc ;Some read
jmp short inst02
inst01:
clc ;None read
Chapter 8 Page 133