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

How to embed hard coded messages in code segment ?

I need to embed a copyright string into code segment. Of course it is easy to do it by providing an assembly module with org psuedo. However the client wants me to write all programs just in C51. What can I do with it then ?

  • How about:

        code const char copyright_string[] = "COPYRIGHT";
    

  • "However the client wants me to write all programs just in C51."

    Graham has given you the answer to your immediate question; however, I think you might need to take this client aside for a few quiet words of explanation on the facts of embedded programming life...!

    I have never come across an embedded product which didn't have any assembler at all in it.
    At the very least, you're going to need a little bit of assembler which runs directly from a reset to set up the 'C' runtime environment - initialising the Stack Pointer, for one.

    Even a PC has to do this, but it's all over long before Windows (or whatever) loads, so Applications programmers never see it!

    The C51 Manual describes the startup code needed - see STARTUP.A51.

  • Hi John,

    Can you please describe how you would do it in assembly using an org. I am trying to locate a couple of constant bytes at a particular part of code space...

    Thanks,
    AL