Thread: about bioscom.

  1. #1
    Registered User
    Join Date
    Nov 2014
    Posts
    2

    about bioscom.

    hello ,
    i have a question that i m using a bioscom function but it is not work properly , sample code of bioscom is also not work properly, my comp specification is windows7 -32 bit, & compiler specification is turbo c dos box -16 bit.

    --here is the code ,and the problem is this that this code can't b able to access the com port of my pc.
    Code:
    #include
    #include 
    #define COM3 2
    #define DATA_READY 0x100
    #define [COLOR=#009900 !important]SETTINGS[/COLOR] ( 0x80 | 0x02 | 0x00 | 0x00)
    int main(void)
    {
          int in, out, status;
          bioscom(0, SETTINGS, COM1); /*initialize the port*/
          printf("Data sent to you: ");
          while (1)
         {
                 status = bioscom(3, 0, COM1); /*wait until get a data*/
                 if (status & DATA_READY)
                 if ((out = bioscom(2, 0, COM1) & 0x7F) != 0) /*input a data*/
                 putch(out);
                 if (kbhit())
                 {
                         if ((in = getch()) == 27) /* ASCII of Esc*/
                         break;
                         bioscom(1, in, COM1); /*[COLOR=#009900 !important]output[/COLOR] a data*/
                  }
           }
           return 0;
    }
    thanks in advance

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Note: this is not a C programming question. It is either windows programming or MS-DOS programming, depending on how one views it.


    Windows 7 (like all the NT windows family) is designed to prevent direct access by user code to the hardware and BIOS of the host machine. Your sample code relies on direct access to hardware and/or BIOS (for access to the com port, access to the keyboard, etc).

    A 16-bit version of Turbo C will probably accept the code, since it targeted MS-DOS and/or early versions of windows that permitted such things. However, the executable will not run on a modern windows.

    The solution to your problem ..... depends on what you are ACTUALLY trying to do.

    Since the technique your sample code is using is obsolete - as presumably is the device you are attempting to communicate with via COM port - you might be better off starting with finding a more modern device (for example, with a USB interface) that does whatever it is your device does.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  3. #3
    Registered User
    Join Date
    Nov 2014
    Posts
    2

    Smile

    Thanks for info.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with bioscom()
    By b2s in forum C Programming
    Replies: 3
    Last Post: 04-04-2012, 07:04 AM
  2. bioscom(1,'s',COM3)
    By ommm in forum C Programming
    Replies: 1
    Last Post: 05-02-2008, 02:38 AM
  3. about bioscom(1,in,COM1)
    By ommm in forum C Programming
    Replies: 1
    Last Post: 04-30-2008, 07:52 AM
  4. Bioscom serial communication
    By PierreB in forum C Programming
    Replies: 1
    Last Post: 10-24-2004, 10:04 AM

Tags for this Thread