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

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
  • Are you asking the correct question?

    Wouldn't it be better to try to describe what problem you need to solve, instead of jumping into the middle of something, and ask how to get further now when you are stuck?

    Why do you need two fixed code regions?

    And you are mixing the use of "main()" and "main" - are both intended to mean the "main()" C function? You are aware that the compiler will not place "main()" first in the code block - you also have a startup file with lots of things that must be done before - the C runtime library requires initialization of variables etc.

Reply
  • Are you asking the correct question?

    Wouldn't it be better to try to describe what problem you need to solve, instead of jumping into the middle of something, and ask how to get further now when you are stuck?

    Why do you need two fixed code regions?

    And you are mixing the use of "main()" and "main" - are both intended to mean the "main()" C function? You are aware that the compiler will not place "main()" first in the code block - you also have a startup file with lots of things that must be done before - the C runtime library requires initialization of variables etc.

Children
No data