This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Header Files

Hi, Where can I find the header files in C51.
for instance:
#include <Reg932.h>
I need the ones for memory and I/O
for instance:
#include <memory.h>
#include <io.h>
those header files cannot be opened by C51.

Thank you

  • You're looking in the wrong direction. Your problem is not that you cannot find those header, it's that you shouldn't be searching for them in the first place.

    <memory.h> and <io.h> are platform-specific header files usually found on the PC platform. C51 doesn't have them.

  • What do I do for my project then? Do I need another compiler?
    Help me please!

    Thank you

  • I forgot to ask what platform-specific header files are?

  • "Platform-specific" just means that the headers are not part of ANSI standard C, and thus cannot be expected to exist on any platform on which you try to compile the code.

    You need to figure out which functions from memory.h and io.h are actually used by your code, and port those to your new platform. (The functions the compiler doesn't recognize when you take those #include directives out would be a good start.)

    io.h probably contains declarations for "in" and "out" functions for the 80x86 IO space. The 8051 does not have a separate IO space with special instructions. (What? The designers missed a chance to add yet another memory space in the 8051?) The code that used to move bytes to some device mapped into the 80x86 IO space will need to be rewritten to match your new hardware, whether SFRs or registers mapped into the xdata space.

    memory.h could be all sorts of things, depending on the code that you're starting with. Take a look at it in the original project and see what it does.