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.
Porting C54x code to C55x
Started by ●February 3, 2010
Reply by ●February 3, 20102010-02-03
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. �����������������������������������������������������������������������
Reply by ●February 3, 20102010-02-03
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. "
Reply by ●February 3, 20102010-02-03
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. �����������������������������������������������������������������������
Reply by ●February 3, 20102010-02-03
On Feb 3, 10:30�pm, Jerry Avins <j...@ieee.org> wrote:> Can the C55x handle DMA the same way?To my knowledge, yes.
Reply by ●February 3, 20102010-02-03
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. �����������������������������������������������������������������������
Reply by ●February 4, 20102010-02-04
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. /Reine
Reply by ●February 4, 20102010-02-04
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. �����������������������������������������������������������������������
Reply by ●February 4, 20102010-02-04
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.Does this help? http://www.datasheetarchive.com/datasheet-pdf/029/DSA00511910.html It is TI's C54 to C55 migration guide. Clay
Reply by ●February 5, 20102010-02-05
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.






