I now have an unsigned long which was being passed to the inline assembly in
the Registers. That works, of course. But I wanted to directly address the
long variable in my assembly code to eliminate the need to prep the
registers prior to the call.
so I have
unsigned long burnAddress ; defined in the C code
in the inline assembly I have:
EXTRN DATA (burnAddress)
and I access it like this:
mov a,burnAddress ; MSB
..
mov a,burnAddress +1
..
mov a,burnAddress +2
..
mov a,burnAddress +3 LSB
Is this correct?
Thanks
eng
Yes.
A long needs four bytes, but the accumulator fits only
one at a time, so you need four fetches.
--
Tauno Voipio
tauno voipio (at) iki fi
:)
Yes. I was asking about the proper connection for the linker. As it seems I
am not getting the proper values in the assembly.
Thanks.
Try:
unsigned long data burnAddress;
unless you are already compiling in the SMALL model.
Google is not Usenet, nor is their broken Usenet interface in any
way representative of the view others have. In order to make your
posts intelligible you MUST include context. See below for means
of so doing even on Google
In addition you should avoid silly spelling mistakes and
abbreviations, such as the use of i (in place of I) and plz. This
greatly improves readability.
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Oh Please Chuck..
I am trying to milk every nanosecond of speed out of a design and I have a
routine which is currently being passed a LONG in registers. And I was
looking to remove the time it took to load them prior to the call. So I am
attempting to access the long in the routine as:
mov a,burnAddress
..
mov a,burnAddress+1
etc.
But I am getting the wrong data.
When using inline assembly with uVision I can not get the CODE in the
listings so suppose I have to inspect the opcodes in the hex file..
The default data area for this variable would be DATA.
oh plz chk. what a petty wrthls pst.
Nappy wrote:
Rule of thumb with Keil.
Write the sub in C and look at the asm. ( Or at least the data access parts)
if the var is define in C you may get that Underscore thing (_burnAddress ???)
Try it with an int first I THINK Keil calls internal libs for long, but does
ints in place.
That varies by compiler version I guess.
Thank you Neil.
Check if Keil realy use big endian for storing long variables. May be you
need to exchnge MSB with LSB.