Discussion Forum

Specifying the start address

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Mohammad Adel
Posted
27-Jun-2004 15:28 GMT
Toolset
C51
New! Specifying the start address
In assembly, the "ORG" directive can be used to specify the start address of the code.

Can this be done in C? if possible then How?

..Thanx
Read-Only
Author
Dan Henry
Posted
27-Jun-2004 17:18 GMT
Toolset
C51
New! RE: Specifying the start address
Not with the C language or the C compiler. It's a linker parameter.
Read-Only
Author
Mohammad Adel
Posted
27-Jun-2004 17:44 GMT
Toolset
C51
New! RE: Specifying the start address
So, how can it be changed?

Thanx
Read-Only
Author
Jon Ward
Posted
27-Jun-2004 18:05 GMT
Toolset
C51
New! RE: Specifying the start address
Take a look at the following knowledgebase article:

http://www.keil.com/support/docs/189.htm

Jon
Read-Only
Author
Drew Davis
Posted
29-Jun-2004 00:02 GMT
Toolset
C51
New! RE: Specifying the start address
C programs begin at main(), by definition. You could use the linker relocation controls to move the location of main().

It's more likely that you want to move all of your code. See the article Jon posted. Or, if you want a fixed address so that some other bit of code can call your code, you probably want to begin earlier than main() itself. See STARTUP.A51.

Next Thread | Thread List | Previous Thread Start a Thread | Settings