In article <e5olhs$rfh$1@ss408.t-com.hr>, Dejan
<dejan@removethis.dilogic.hr> writes
>Oops - I assumed OP is talking about Keil C51 compiler - that one has no
>in-line asm capabilities.
You must have a very old version of C51. Every version I've used going
back at least 10 years has had #pragma asm and #pragma endasm, albeit
the slightly clunky implementation means you need to add an extra build
step or simply tick an extra box in the uVision IDE to assemble the
output of the compiler - but you can do inline assembler (although I
prefer to just put the assembler it its own module).
Reply by Paul Keinanen●June 2, 20062006-06-02
On 31 May 2006 04:50:13 -0700, "ishita" <aparna247@gmail.com> wrote:
>How to implement assembly instructions using Keil compiler?
Assuming the develoment system includes a separate assembler and a
linker, create a separate assembler source file, write your assembler
function into it using the C-compiler calling convention.
Run the assembly source file through the asembler.
In the C-file call your function as any other C-function, compile
C-program and link with object code generated by assembler.
Paul
Reply by Dejan●June 2, 20062006-06-02
"Richard" <nospam@thanks.com> wrote in message
news:0Tifg.78821$wl.34308@text.news.blueyonder.co.uk...
> My Keil project contains the following line (amongst others) within a C
> function...
>
> __asm{ ADD LR, LR, #4 };
>
> ...but I am using ARM compiler. Don't know what SRC is so suspect your
> target is different.
>
> Strangely I learned how to do this by reading the manual.
>
> Regards,
> Richard.
>
> http://www.FreeRTOS.org
> *Now for ARM CORTEX M3!*
>
>
Oops - I assumed OP is talking about Keil C51 compiler - that one has no
in-line asm capabilities. Obviously, ARM (and maybe some other) version
has...
- Dejan
Reply by ishita●June 1, 20062006-06-01
There are 'asm' and 'endasm' derectives in keil compiler. but for using
asm statements that is not sufficient. One option needs to be enabled,
which I couldn't find.
Best regards.
Richard wrote:
> "Dejan" <dejan@removethis.dilogic.hr> wrote in message
> news:e5kd84$fvn$1@ss408.t-com.hr...
> > "ishita" <aparna247@gmail.com> wrote in message
> > news:1149085381.017972.107220@i40g2000cwc.googlegroups.com...
> >>
> >> I read all available documents. I used #pragma asm & endasm derectives.
> >> Also enabled SCR control ooption. But still getting error while
> >> compilation. I want to complete the project as early as possible. So if
> >> anybody knows please tell me.
> >> Best regards.
> >>
> >>
> >
> > There's no "#pragma asm" directive in Keil compiler. Also, there's no SCR
> > control
> > option. There's SRC one, though. That one generates source code from you
> > C-code
> > which you can run through ASM. Otherwise, you cannot interleave asm
> > instructions
> > with the C-source.
> >
> > - Dejan
>
> My Keil project contains the following line (amongst others) within a C
> function...
>
> __asm{ ADD LR, LR, #4 };
>
> ...but I am using ARM compiler. Don't know what SRC is so suspect your
> target is different.
>
> Strangely I learned how to do this by reading the manual.
>
> Regards,
> Richard.
>
> http://www.FreeRTOS.org
> *Now for ARM CORTEX M3!*
Reply by Richard●May 31, 20062006-05-31
"Dejan" <dejan@removethis.dilogic.hr> wrote in message
news:e5kd84$fvn$1@ss408.t-com.hr...
> "ishita" <aparna247@gmail.com> wrote in message
> news:1149085381.017972.107220@i40g2000cwc.googlegroups.com...
>>
>> I read all available documents. I used #pragma asm & endasm derectives.
>> Also enabled SCR control ooption. But still getting error while
>> compilation. I want to complete the project as early as possible. So if
>> anybody knows please tell me.
>> Best regards.
>>
>>
>
> There's no "#pragma asm" directive in Keil compiler. Also, there's no SCR
> control
> option. There's SRC one, though. That one generates source code from you
> C-code
> which you can run through ASM. Otherwise, you cannot interleave asm
> instructions
> with the C-source.
>
> - Dejan
My Keil project contains the following line (amongst others) within a C
function...
__asm{ ADD LR, LR, #4 };
...but I am using ARM compiler. Don't know what SRC is so suspect your
target is different.
Strangely I learned how to do this by reading the manual.
Regards,
Richard.
http://www.FreeRTOS.org
*Now for ARM CORTEX M3!*
Reply by Dejan●May 31, 20062006-05-31
"ishita" <aparna247@gmail.com> wrote in message
news:1149085381.017972.107220@i40g2000cwc.googlegroups.com...
>
> I read all available documents. I used #pragma asm & endasm derectives.
> Also enabled SCR control ooption. But still getting error while
> compilation. I want to complete the project as early as possible. So if
> anybody knows please tell me.
> Best regards.
>
>
There's no "#pragma asm" directive in Keil compiler. Also, there's no SCR
control
option. There's SRC one, though. That one generates source code from you
C-code
which you can run through ASM. Otherwise, you cannot interleave asm
instructions
with the C-source.
- Dejan
Reply by ishita●May 31, 20062006-05-31
I read all available documents. I used #pragma asm & endasm derectives.
Also enabled SCR control ooption. But still getting error while
compilation. I want to complete the project as early as possible. So if
anybody knows please tell me.
Best regards.
typhon62 wrote:
> ishita wrote:
> > Hi everybody!
> > How to implement assembly instructions using Keil compiler?
> > Best regards,
> > Ishita
>
> Read your Keil documentation or ask Keil, they are very helpfull.
Reply by typhon62●May 31, 20062006-05-31
ishita wrote:
> Hi everybody!
> How to implement assembly instructions using Keil compiler?
> Best regards,
> Ishita
Read your Keil documentation or ask Keil, they are very helpfull.
Reply by typhon62●May 31, 20062006-05-31
ishita wrote:
> Hi everybody!
> How to implement assembly instructions using Keil compiler?
> Best regards,
> Ishita
Read your Keil documentation or ask Keil, they are very helpfull.
Reply by ishita●May 31, 20062006-05-31
Hi everybody!
How to implement assembly instructions using Keil compiler?
Best regards,
Ishita