Computing.Net > Forums > Disk Operating System > transmit and recieve through serial port

transmit and recieve through serial port

Reply to Message Icon

Original Message
Name: Maria
Date: March 16, 2001 at 23:38:06 Pacific
Subject: transmit and recieve through serial port
Comment:

I need help writing a small assembly language program debug in DOS. The program must transmit and recieve through the serial port.
Example
int 14h; initializes serial port
Thanks.


Report Offensive Message For Removal


Response Number 1
Name: Ayexby
Date: March 17, 2001 at 07:02:11 Pacific
Reply: (edit)


You would want to select the parity, stop bits, and baud rate you want to use on both systems.
For word length (data bits), you can select between 7 or 8. Use 2 for 7 or 3 for 8 bits.
The lowest 2 bits of the vlue in AL when the bios function call is made will determine the word length.
Bit 2 of AL will determine the number of stop bits. 0=1, 1=2 stop bits.
Bits 3 & 4 set the parity. 00=no parity, 01=odd, and 11=even.
The high 3 bits set the baud rate. 000=110 baud. 001=150 baud. From there on up, each additional incrementation will double the baud rate, so a reasonable value might be 101 for 2400 baud. (Usually very reliable) Max value for the 8250 is 111, or 9600 baud.

So, for a wordlength of 8 bits, even parity, 1 stop bit, 2400 baud, I would do this:
PLace the wordlength of 3 into AL, OR AL with 00 (no change) for stop bits of 1, OR AL with the parity value of 18 (HEX), OR AL with A0 for baudrate.
Then I would place a zero in AH, to specify function 0 to initialize the serial port, a 0 in DX to specify COM 1 (don't remember how to choose COM 2--Maybe it's a 1).
Now I would execute interrupt 14H.

At this point the port is opened, and I can either read from it or write to it, using the correct procedure, of course.

I'll leave the transmission procedure for someone else, or another time, as I'm getting a headache just from this much.:)


Report Offensive Follow Up For Removal

Response Number 2
Name: Murat
Date: June 5, 2001 at 16:17:01 Pacific
Reply: (edit)

See this address Maria :)

http://webster.cs.ucr.edu/Page_asm/ArtofAssembly/CH13/CH13-3.html#HEADING3-1


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: transmit and recieve through serial port

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 6 Days.
Discuss in The Lounge