title: RS-232 confusion under C++
body: <p>What's the problem in given code? Why it is not showing the output for rs232 when we connect it by the d-9 connector with the short of pin number 2 &amp; 3 in that?</p>
  
  <pre><code>#include &lt;bios.h&gt;
  #include &lt;conio.h&gt;
  #define COM1       0
  #define DATA_READY 0x100
  #define SETTINGS ( 0x80 | 0x02 | 0x00 | 0x00)
  int main(void)
  {
     int in, out, status;
     bioscom(0, SETTINGS, COM1); /*initialize the port*/
     cprintf("Data sent to you:  ");
     while (1)
     {
        status = bioscom(3, 0, COM1); /*wait until get a data*/
        if (status &amp; DATA_READY)
             if ((out = bioscom(2, 0, COM1) &amp; 0x7F) != 0)  /*input a data*/
                putch(out);
             if (kbhit())
             {
                if ((in = getch()) == 27)   /* ASCII of Esc*/
                   break;
                bioscom(1, in, COM1);   /*output a data*/
             }
     }
     return 0;
  }
  </code></pre>