Thanks in advance
Emilio Bustos <eebu...@infovia.com.ar> wrote in message
news:7uf26h$fga$6...@autumn.news.rcn.net...
Yes
+AD4-i need an asm routine to read the com port
+ADs- call this routine with DX+AD0-baseaddr, 3F8, 2F8, 3E8 or 2E8 (COM1-4)
+ADs-
rs232ReadByte PROC NEAR
add dx, 5
rs232RBWait:
in al, dx
test al, 1
jz rs232RBWait
sub dx, 5
in al, dx
ret
rs232ReadByte ENDP
+ADs- call this routine with DX+AD0-baseaddr, 3F8, 2F8, 3E8 or 2E8 (COM1-4) and
AL+AD0-byte
+ADs-
rs232WritePROC NEAR
mov ah, al
add dx, 5
rs232RWait:
in al, dx
test al, 20h
jz rs232RWait
sub dx, 5
mov al, ah
out dx, al
ret
rs232WriteENDP
+AD4-is it very different with LPT?
Yes
>Hi, anyone can help me?
>i need an asm routine to read the com port
moddatp dw 0 ;for modem data port storage
modctlp dw 0 ;for modem control port storage
;Uncomment the appropriate COM port number addresses.
;
;COM 1:
; mov moddatp,03F8h ;modem data register address
; mov modctlp,03FDh ;modem status register address
;COM 2:
; mov moddatp,02F8h
; mov modctlp,02FDh
;COM 3:
; mov moddatp,03E8h
; mov modctlp,03EDh
;COM 4:
; mov moddatp,02E8h
; mov modctlp,02EDh
portstatus:
mov dx,modctlp ;point DX to port status register
in al,dx ;read it into register AL
and al,1 ;is anything there?
jz portstatus ;no, so go check again
mov dx,moddatp ;yes, so point DX to port data register
in al,dx ;read it into register AL
;
;The byte received from the COM port in now is register AL, so
;insert code here to do whatever you want to do with the byte.
;
jmp portstatus ;go do it again
>is it very different with LPT?
Yes.
For more serial I/O solutions visit http://www.taltech.com
On 18 Oct 1999 12:01:21 GMT, "Emilio Bustos" <eebu...@infovia.com.ar>
wrote:
>Hi, anyone can help me?
>i need an asm routine to read the com port
>is it very different with LPT?
>
>Thanks in advance
>
>
>