brain wrote:
> Hi group!
>
> I'm porting some code written for the C54x to run on the C55x, and one
> of the instructions is really giving me a headache. The code:
>
> .cpl_on ; Tell compiler CPL=1
> ST #0, 4 ; Store #0 at (SP + 4)
>
> The compiler (cl55) tells me:
> "example.asm", ERROR! at line 2: [E0003] This address mode is
> invalid in CPL=1
> mode
> ST #0, 4 ; Store #0 at (SP + 4)
>
> 1 Assembly Error, No Assembly Warnings
>
> The code compiles fine with a C54x compiler. I've tried to google the
> problem, without finding any solution. Any help with greatly
> appreciated.
What does the C54 compiler manual say about what .cpl_on does?
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
brain wrote:
> On Feb 3, 6:04 pm, Jerry Avins <j...@ieee.org> wrote:
>
>> What does the C54 compiler manual say about what .cpl_on does?
>
> "The .cpl_on directive begins a block of code in which direct memory
> addressing (DMA) is relative to the stack pointer. "
Can the C55x handle DMA the same way?
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
brain wrote:
> On Feb 3, 10:30 pm, Jerry Avins <j...@ieee.org> wrote:
>
>> Can the C55x handle DMA the same way?
>
> To my knowledge, yes.
Then there's probably a way to tell the compiler to do it, but evidently
the syntax has changed. Can you write a macro that incorporates inline
assembler?
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
On Feb 4, 2:06*am, Jerry Avins <j...@ieee.org> wrote:
> brain wrote:
> > On Feb 3, 10:30 pm, Jerry Avins <j...@ieee.org> wrote:
>
> >> Can the C55x handle DMA the same way?
>
> > To my knowledge, yes.
>
> Then there's probably a way to tell the compiler to do it, but evidently
> the syntax has changed. Can you write a macro that incorporates inline
> assembler?
Why should I have to tell the C55x-compiler to do direct memory
addressing like the C54x if they're doing it the same way? One thing
that seems to have changed is how to tell the compiler that it should
do direct memory addressing _relative_ to the SP. The C55x compiler
doesn't understand the ".cpl_on" directive, this information has to be
fed to it via command line options.
I really don't understand your suggestion about inline assembler, I am
already writing in assembler.
brain wrote:
> On Feb 4, 2:06 am, Jerry Avins <j...@ieee.org> wrote:
>> brain wrote:
>>> On Feb 3, 10:30 pm, Jerry Avins <j...@ieee.org> wrote:
>>>> Can the C55x handle DMA the same way?
>>> To my knowledge, yes.
>> Then there's probably a way to tell the compiler to do it, but evidently
>> the syntax has changed. Can you write a macro that incorporates inline
>> assembler?
>
> Why should I have to tell the C55x-compiler to do direct memory
> addressing like the C54x if they're doing it the same way? One thing
> that seems to have changed is how to tell the compiler that it should
> do direct memory addressing _relative_ to the SP. The C55x compiler
> doesn't understand the ".cpl_on" directive, this information has to be
> fed to it via command line options.
>
> I really don't understand your suggestion about inline assembler, I am
> already writing in assembler.
In that case, the suggestion makes no sense. It was based on a
misconception. If a command-line option works, is the problem solved?
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
On Feb 3, 10:57*am, brain <reine...@gmail.com> wrote:
> Hi group!
>
> I'm porting some code written for the C54x to run on the C55x, and one
> of the instructions is really giving me a headache. The code:
>
> * * * * .cpl_on * * * * * * * * ; Tell compiler CPL=1
> * * * * ST #0, 4 * * * * * * * *; Store #0 at (SP+ 4)
>
> The compiler (cl55) tells me:
> "example.asm", ERROR! * at line 2: [E0003] This address mode is
> invalid in CPL=1
> * * * * * * * * * * * * * * * * * * * * mode
> * * * * * * * * ST #0, 4 * * * * * * * *;Store #0 at (SP + 4)
>
> 1 Assembly Error, No Assembly Warnings
>
> The code compiles fine with a C54x compiler. I've tried to google the
> problem, without finding any solution. Any help with greatly
> appreciated.
On Feb 4, 10:06*pm, Jerry Avins <j...@ieee.org> wrote:
> In that case, the suggestion makes no sense. It was based on a
> misconception. If a command-line option works, is the problem solved?
No, the problem isn't solved. Both the C54x and C55x compiler can be
told to do direct memory adressing using the stack pointer, but if
differs in how to tell them (command line versus assembler directive).
But the problem isn't that the compiler doesn't understand that it
should do direct memory addressing relative the stack pointer, the
problem is that the C55x compiler for some reason has a problem
translating the C54x instruction " ST #immediate, Smem" when using SP-
relative addressing.
Thanks, but I've already read it, and most of the other reference
documentation from TI about C54x/C55x. But this documention gives no
hints that this instruction / way of addressing would be a problem
when porting C54x code to C55x.
brain wrote:
> On Feb 4, 10:06 pm, Jerry Avins <j...@ieee.org> wrote:
>
>> In that case, the suggestion makes no sense. It was based on a
>> misconception. If a command-line option works, is the problem solved?
>
> No, the problem isn't solved. Both the C54x and C55x compiler can be
> told to do direct memory adressing using the stack pointer, but if
> differs in how to tell them (command line versus assembler directive).
> But the problem isn't that the compiler doesn't understand that it
> should do direct memory addressing relative the stack pointer, the
> problem is that the C55x compiler for some reason has a problem
> translating the C54x instruction " ST #immediate, Smem" when using SP-
> relative addressing.
>
> Thanks for trying to help me.
Thanks for not much, though. I assume that where you wrote "compiler",
you meant "assembler".
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
On Feb 5, 3:59*pm, Jerry Avins <j...@ieee.org> wrote:
> Thanks for not much, though. I assume that where you wrote "compiler",
> you meant "assembler".
Both yes and no. I'm actually using the the compiler frontend (cl55),
which itself uses the assembler backend, even if it's perfectly OK to
use the assembler directly yourself.