I am using an 8051 (C51/BL51) with no off-chip memory. I have two functions with parameters:
void Detect( U8 iLed )
and
static U8 INHSampleHandler( U16 u16Sample )
Now I understand that Keil will allocate a variable (in DATA) for these. The problem seems to be that the locator is using the same memory location for both. I cannot understand why.
Below are excerpts from the scratchpad showing 2 "D:0026H". These are the only places these symbols are declared. Any ideas what I'm doing wrong?
Thanks, Jeff
BL51 BANKED LINKER/LOCATER V5.12 07/14/2011 09:36:23 PAGE 1 BL51 BANKED LINKER/LOCATER V5.12, INVOKED BY: Z:\TOOLS\SOFTWARE\KEIL\BL51.EXE Z:\Software\FB_CPU_Init.obj, >> Z:\Software\Settings.obj, Z:\Software\Glo >> bals.obj, Z:\Software\Devices\Clock.obj, Z:\ >> Software\Devices\Flash.obj, Z:\Software\Devices\HMI.obj >> , Z:\Software\Devices\INH.obj, Z:\ >> Software\Devices\ADC.obj, Z:\Software\Devices\Timer.obj, Z >> :\Software\Builds\TestINH - 06-00039-21-09\Main.obj >> , Z:\Software\Test\Test_Button.obj, Z:\So >> ftware\Builds\TestINH - 06-00039-21-09\Version.obj TO Z:\ >> Software\Builds\TestINH - 06-00039-21-09\06-00039-21-09-xx.wsp >> RS (256) PL (68) PW (78) XDATA (?XD?SETTINGS (0X0)) CODE (?CO?VERSION (0X7 >> FC0)) MEMORY MODEL: SMALL Deleted for brevity ------- PROC _INHSAMPLEHANDLER D:0026H SYMBOL u16Sample C:0BF1H LINE# 150 C:0BF5H LINE# 151 C:0BF5H LINE# 207 C:0BF7H LINE# 208 ------- ENDPROC _INHSAMPLEHANDLER ------- ENDMOD INH Deleted for brevity C:09FEH PUBLIC _Detect C:074EH PUBLIC main ------- PROC _DETECT D:0026H SYMBOL iLed
"who might take that at face falue."
sounds like poor programmers, rather than the message itself, are the problem.
then the real cure is to educate the programmers or let them suffer through prolonged debugging to learn their mistakes is the solution.
rather than bastardizing a perfectly correct and reasonable message.
I disagree that it is perfectly correct, and I disagree that it is reasonable.
"the real cure is to educate the programmers"
Indeed - by not giving misleading statements.
"I disagree that it is perfectly correct, and I disagree that it is reasonable."
if you look at IB's statements in their totality, he essentially said that it is ok to call a function from within an isr, as long as you know what you are doing.
he may not have put the two statements physically next to each other, but I think if anyone were to think the two in separation, s/he has a deeper problem, with comprehension.
"Indeed - by not giving misleading statements."
people learn a lesson far better if they experience it in a painful way.
unless you can shield everyone from every misleading / less-than-truthful statement, it is probably to their interest for them to learn to identify and interpret such statements on their own.
you are talking out of both sides of your mouth. Here you say "let them suffer" in other places you criticise that a solution is not provided.
Erik (who is not afraid of putting his name to his statements)
"unless you can shield everyone from every misleading / less-than-truthful statement, it is probably to their interest for them to learn to identify and interpret such statements on their own."
You don't seem to know what foot to stand on. In this case, it's "close enough". In other threads, you are willing to spend hours fighting for the use - or nonuse - of a single word.
"Erik (who is not afraid of putting his name to his statements)"
how heroic you are!
on that basis along, they should award you the Nobel prize for Bravery and two Metals of Honor (not just one!)
:)
"You don't seem to know what foot to stand on. In this case, it's "close enough". In other threads, you are willing to spend hours fighting for the use - or nonuse - of a single word."
because each case is different. while doing something is in-material in one case, doing the same thing may be material in others.
so the seeming contradiction is fairly easy to understand, if you have common sense.
Indeed!
One moment, you're criticising fine detail and ignoring the context; then, just to be contrary, you decide to do the opposite!
Make up your mind!
people learn a lesson far better if they experience it in a painful way. (Asheley)
That is often not an option in the commercial world...
"One moment, you're criticising fine detail and ignoring the context; then, just to be contrary, you decide to do the opposite!"
I thought I had answered that, in the post that yours above responded to.
but in case you missed it, sometimes fine details matter, and in other cases, they don't.
so it is hard and wrong to insist that one always pays attention to fine details - they are called "fine details" for a reason.
hope it helps.
Making a bold statement like "There are NO problems" - with the big emphasis on the NO - is not a fine detail. It is plain wrong.
this is exactly what IB wrote:
'There's NO problem with calling a function from an '51 ISR.
However, like most tasks, the programmer needs to understand the mechanism(s) involved and take appropriate steps to ensure the cogs fit correctly.
FWIW, we have plenty of code that calls functions from ISRs. It's all written in assembler and there have been no reported problems. Quite a few of those functions are inherently re-entrant. They are called from both ISR and mainline code. Most importantly, parameters and local variables are passed in registers.
No problem, so long as you know what you're doing, period.'
vs. what you characterized what he wrote:
"There are NO problems"
come on. would any reasonably intelligent people equate the two?
as I stated before, the two of you said the same thing, with different emphasis. and there is no point in pushing any of your statements to the extreme to justify the other.
You want to hide your spewing bile behind anonymity, I am, at least, willing to stand behind what I post.
Erik
"I am, at least, willing to stand behind what I post."
far more importantly, you have the bravery to put your name to your statement, as you proudly and publicly stated.
and that's just extremely heroic, and because of that and that alone, you should be the target of national admiration.
thus I think you deserve not just the nobel prize for bravery but also two (not just one) Metals of Honor!
"Making a bold statement like "There are NO problems" - with the big emphasis on the NO - is not a fine detail. It is plain wrong."
Well, thanks for that vote of confidence ;)
However - I do not believe it is wrong at all. There aren't any problems - So long as everything about the situation is understood. Nothing specific about '51 architecture there.
If I were to say that there were no problems with boiling an egg I guess I'd get a complaint from someone pointing out that it shouldn't be done because someone might leave the gas on and the house might burn down.