placing code at specific address

in main() I have two pieces of code - the first one needs to start at the beginning of main and it is very small the second one will be placed just after at the beginnig adddress + 200h
can you tell me the directive(s) to use to set this second piece of code to be placed at this specific address after the beginning of main()

Parents
  • The traditional way to do this is to define a section and use a #pragma to put the code into that section, typically on a function-by-function basis. The Keil IDE has a simple way of doing this for all code in a single file: right-click on your file and use the drop-down boxes to force code data into a segment your define in the target options.

    From your question it sounds like you want code within your main() to be at specific addresses. I'm not sure how easy that is without resorting to inline-assembly.

    Here's a little more detail from the ARM website on the general topic.
    infocenter.arm.com/.../BABDJCAA.html

    Andrew

Reply
  • The traditional way to do this is to define a section and use a #pragma to put the code into that section, typically on a function-by-function basis. The Keil IDE has a simple way of doing this for all code in a single file: right-click on your file and use the drop-down boxes to force code data into a segment your define in the target options.

    From your question it sounds like you want code within your main() to be at specific addresses. I'm not sure how easy that is without resorting to inline-assembly.

    Here's a little more detail from the ARM website on the general topic.
    infocenter.arm.com/.../BABDJCAA.html

    Andrew

Children
More questions in this forum