Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Keil C CODE MEMORY INITIAL ADDRESS???

Status
Not open for further replies.

buts101

Full Member level 3
Joined
Apr 29, 2005
Messages
168
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Activity points
2,867
hello guys
I am using Keil compiler to write programming 8051 microcontrollers in C language.

My code compiles and generates HEX file. But i need to start that CODE MEMORY from 0100H. I

know how to start from assembling language i.e.

-----
jmp main

org 0100h

main: p1,#00h
;other statements


-------

I need the same trick that may be use in C language. But C language doesn't take "ORG

0100h".

So, how can i start the HEX from 0100h in 8051 code memory after compiler C code.


Looking forward for your help


Thank you
Buts101
 

create a separate file..........say function.c

and in that file create a function

function1(/*arguments*/)
{
#pragma asm
//
// the assembly code that you want to execute
//
#pragma endasm
}
 

Goto Project -> Option for Target -> BL51 Locate. Put the name of the function and file you want to relocate in "Code" text box, like

?pr?myfunction?myfilename(0100h)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top