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.

How to variable which exists outside the asm place in Keil?

Status
Not open for further replies.

SphinX

Advanced Member level 3
Joined
Jan 25, 2002
Messages
822
Helped
58
Reputation
116
Reaction score
29
Trophy points
1,308
Location
EGYPT
Activity points
7,045
Keil and Assembly

Hi,

How can i call a variable which exist outside the asm place ?

For example this doesn't work. Count is undiffiend symbol.

void main ()
{
unsgined char count;

.
.
#pragma asm
Mov Count,10
.
.

#pragma endasm

}

SphinX
 

ke*il and Assembly

variable IS different in ke*il, you can find a pdf file named "c51.pdf" in you install dir. Read it , find your solution!
 

Re: Keil and Assembly

Try placing a '_' character in front of your variable
 

Re: Keil and Assembly

I have tried many times to come up with a good solution to this problem, most compilers will accept _ before the variable name, but not keil.

The problem is keil will rename a local variable, eg. char temp will become temp?046 and so you do not know the name of the variable to use in the inline asm.
You can look in the src file produced but this variable name can change.

You also have to use the #pragma src directive (at the top of your file), aswell as #pragma asm/endasm.

Hope this sort of helps, has anyone come up with a solution ?
NTFreak
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top