How to set DTR & RTS for a Modem using INT 14h

I wrote a program for COM port communication using Assembly.
I could initialize COM port, send and receive data by calling BIOS's INT 14h. Howerver, I have to change RTS and
DTR bit in my program. Does int 14 support this operation?
How to implemente this? Do I have to write assembly code
for 8250 Controller?
hbhAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
eek105Connect With a Mentor Commented:
In general, there is no bios function.  PS/2 function 5 would do what you want.  It is just an io port, so's all you have to do is
read in the value of the modem control register(base + 4) and then set bit 1 for RTS and set bit 0 for DTR.  
You can read the bios area for the base addresses or trust that the following is correct:
#ifdef COM1
#define SERIAL_OUT 0x3f8
#define SERIAL_IN 0x3f8
#define SERIAL_STATUS 0x3fd

#define FIFO_CONTROL 0x3fa
#define LINE_CONTROL 0x3fb
#define MODEM_CONTROL 0x3fc
#define LINE_STATUS 0x3fd
#define MODEM_STATUS 0x3fe
#define BAUD_LOW 0x3f8
#define BAUD_HIGH 0x3f9
#define INT_ENABLE 0x3f9
#endif
               
#ifdef COM2
#define SERIAL_OUT 0x2f8
#define SERIAL_IN 0x2f8
#define SERIAL_STATUS 0x2fd

#define FIFO_CONTROL 0x2fa
#define LINE_CONTROL 0x2fb
#define MODEM_CONTROL 0x2fc
#define LINE_STATUS 0x2fd
#define MODEM_STATUS 0x2fe
#define BAUD_LOW 0x2f8
#define BAUD_HIGH 0x2f9
#define INT_ENABLE 0x2f9
#endif        
0
 
hbhAuthor Commented:
I know these addresses, my question is:
Can I write an assembly code to make some OUT or IN operation
to these ports together with calling BIOS interrupt (INT 14h)?

0
 
eek105Commented:
ok, so i left out one step above
It is just an io port, so's all you have to do is
       read in the value of the modem control register(base + 4) and then set bit 1 for RTS and set bit 0 for DTR, then write the result back to the modem control register.  No bios call.
If you are doing this under windows this will do you no good at all, you have to use the operating system API.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.