Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RS232 comunications

48 views
Skip to first unread message

Emilio Bustos

unread,
Oct 18, 1999, 3:00:00 AM10/18/99
to
Hi, anyone can help me?
i need an asm routine to read the com port
is it very different with LPT?

Thanks in advance

Randall Hyde

unread,
Oct 20, 1999, 3:00:00 AM10/20/99
to
The "UCR Standard Library for 80x86 Assembly Language Programmers"
contains a serial port driver for DOS. You can also read about this
code in "The Art of Assembly Language Programming".
You can find both at http://webster.cs.ucr.edu
Randy Hyde

Emilio Bustos <eebu...@infovia.com.ar> wrote in message
news:7uf26h$fga$6...@autumn.news.rcn.net...

Thomas Kjoernes

unread,
Oct 20, 1999, 3:00:00 AM10/20/99
to
Emilio Bustos wrote in message +ADw-7uf26h+ACQ-fga+ACQ-6+AEA-autumn.news.rcn.net+AD4-...
+AD4-Hi, anyone can help me?


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


anon...@bogus_address.con

unread,
Oct 20, 1999, 3:00:00 AM10/20/99
to

On 1999-10-18 eebu...@infovia.com.ar said:

>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.


Thomas Lutz

unread,
Oct 23, 1999, 3:00:00 AM10/23/99
to
There used to be a book called the MSDOS developers guide from
Microsoft that had a complete assembly language serial communications
program in it. If you cannot find the book (you may want to look in a
library because it is probably out of print) then you could always
purchase a serial communications library like PDQComm for DOS from
Crescent software or a library from Greenleaf sofware. I believe that
both companies provide complete source code.

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
>
>
>

0 new messages