[uClinux-dev] about the inline assemble error , about ColdFire MCF5249

Greg Ungerer gerg at snapgear.com
Thu Aug 4 19:55:24 EDT 2005


Hi Qiao,

Qiao Guangjun-rg273c wrote:
> I installed the m68k-elf-tools-20030314, and to build GNU tools that 
> support ColdFire5249's EMAC, I install binutils-0501xx.tar.bz2  too.
> And the GNU tools compile the assemble program well, but as to inline 
> assemble, error occured!
> 
> [root at ellis result]# m68k-elf-gcc -Wa,-m5249 -c test.c -O4 -W -Wall

You need to tell the compiler the cpu option, so you need to pass
it the -m5249 (or if older compiler then -m5200). Your command line
is only passing it to the assembler phase (using -Wa,).

Regards
Greg





> /tmp/ccun8bu7.s: Assembler messages:
> /tmp/ccun8bu7.s:13: Error: operands mismatch -- statement `movm.l 
> #0x3f3c,-(%sp)' ignored
> /tmp/ccun8bu7.s:120: Error: invalid instruction for this architecture; 
> needs 68000 or higher -- statement `lsl.w #1,%d0' ignored
> /tmp/ccun8bu7.s:123: Error: invalid instruction for this architecture; 
> needs 68000 or 68010 or 68020 or 68030 or 68040 or
> 68060 or cpu32 or 5407 or 547x or 548x -- statement `cmp.w 
> #31130,-1194(%a6)' ignored
> /tmp/ccun8bu7.s:125: Error: invalid instruction for this architecture; 
> needs 68000 or higher -- statement `addq.w #1,%d0'
> ignored
> /tmp/ccun8bu7.s:131: Error: invalid instruction for this architecture; 
> needs 68000 or higher -- statement `dbra %d7,.L6' ignored
> /tmp/ccun8bu7.s:135: Error: invalid instruction for this architecture; 
> needs 68000 or higher -- statement `and.w #32767,(%a5)' ignored
> /tmp/ccun8bu7.s:147: Error: invalid instruction for this architecture; 
> needs 68000 or higher -- statement `dbra %d2,.L12'
> ignored
> /tmp/ccun8bu7.s:154: Error: invalid instruction for this architecture; 
> needs 68000 or higher -- statement `or.w #-32768,(%a5)' ignored
> /tmp/ccun8bu7.s:180: Error: operands mismatch -- statement `movm.l 
> #0x3f3c,-(%sp)' ignored
> /tmp/ccun8bu7.s:306: Error: invalid instruction for this architecture; 
> needs 68000 or higher -- statement `and.w #65532,%d0' ignored
> /tmp/ccun8bu7.s:414: Error: operands mismatch -- statement `movm.l 
> #0x3f3c,-(%sp)' ignored
> /tmp/ccun8bu7.s:545: Error: operands mismatch -- statement `mac.w 
> %d1,%d0u,<<,%acc0' ignored
> /tmp/ccun8bu7.s:582: Error: Unknown operator -- statement `return' ignored
> /tmp/ccun8bu7.s:587: Error: operands mismatch -- statement `movm.l 
> (%sp)+,#0x3cfc' ignored
> /tmp/ccun8bu7.s:605: Error: operands mismatch -- statement `movm.l 
> #0x353c,-(%sp)' ignored
> /tmp/ccun8bu7.s:678: Error: operands mismatch -- statement `movm.l 
> (%sp)+,#0x3cac' ignored
> /tmp/ccun8bu7.s:696: Error: operands mismatch -- statement `movm.l 
> #0x3b3c,-(%sp)' ignored
> /tmp/ccun8bu7.s:754: Error: invalid instruction for this architecture; 
> needs 68000 or higher -- statement `dbra %d4,.L27'
> ignored
> /tmp/ccun8bu7.s:758: Error: operands mismatch -- statement `movm.l 
> (%sp)+,#0x3cdc' ignored
> /tmp/ccun8bu7.s:768: Error: operands mismatch -- statement `movm.l 
> #0x3f3c,-(%sp)' ignored
> /tmp/ccun8bu7.s:889: Error: operands mismatch -- statement `movm.l 
> (%sp)+,#0x3cfc' ignored
> /tmp/ccun8bu7.s:907: Error: operands mismatch -- statement `movm.l 
> #0x2f3c,-(%sp)' ignored
> /tmp/ccun8bu7.s:1024: Error: operands mismatch -- statement `movm.l 
> (%sp)+,#0x3cf4' ignored
> /tmp/ccun8bu7.s:1042: Error: operands mismatch -- statement `movm.l 
> #0x3f3c,-(%sp)' ignored
> /tmp/ccun8bu7.s:1173: Error: operands mismatch -- statement `movm.l 
> (%sp)+,#0x3cfc' ignored
> /tmp/ccun8bu7.s:1188: Error: operands mismatch -- statement `movm.l 
> #0x3720,-(%sp)' ignored
> /tmp/ccun8bu7.s:1251: Error: operands mismatch -- statement `movm.l 
> (%sp)+,#0x4ec' ignored
> [root at ellis result]#
>  
> 
>  
> 
>  
> 
> I find the problem is that, in C languge, such as :
> 
> short a, b c;
> 
> a=12;
> 
> b=34;
> 
> c=a+b;
> 
>  
> 
> The compiler will translate them into:
> 
>  
> 
> add.w %d0, %d1
> 
>  
> 
> while in MCF5249, add is long operation, add.w is illegal. only add.l is ok!
> 
>  
> 
> and  movm.l #0x3f3c,-(%sp) is illgegal too,in MCF movem.l is ok while 
> movm.l is not ok!
> 
>  
> 
> And how can I solve the problem.
> 
>  
> 
> a section of my program is attached!
> 
>  
> 
> void  Comp_XX( Word16 *UnqDat, Word16 *PrevDat, Word16 *DataBuff )
> {
>    int   i,j,k ;
> 
>     Word16   Dpnt[Frame+LpcFrame-SubFrLen] ;
>     Word16   Vect[LpcFrame] ;
>     Word16   ShAcf_sf[SubFrames];
>     Word16   Exp   ;
>     Word16   *curAcf;
>     Word16   Pk2;
> 
>     Word32   Acc0,Acc1 ,Acc2,Acc3,Acc4;
> Word16   *Dpnt1;
>    __asm
> (
>        "move.l  %0,%%a0\n"
>       "lea  %1,%%a1\n"
>       "move.l  %%a1,%%a2\n"
>       "adda.l  #240,%%a2\n"
>       "comp1:\n"
>       "move.l   (%%a0)+,(%%a1)+\n" 
>       "move.l   (%%a0)+,(%%a1)+\n" 
>       "cmp.l    %%a2,%%a1\n"                        
> 
>      "move.l  %2,%%a2\n"
>       "move.l  %%a2,%%a3\n"
>       "adda.l  #480,%%a3\n"
> "comp2:\n"
>       "move.l   (%%a2)+,(%%a1)+\n" 
>       "move.l   (%%a2)+,(%%a1)+\n" 
>       "cmp.l   %%a3,%%a2\n"                 
> 
>       "blt   comp2\n"                           
>    :
>    :"m"(PrevDat),"m"(Dpnt),"m"(DataBuff)
>    :"a0","a1","a2","a3"
>      );
> .
> 
> .
> 
> .
> 
> .
> 
> .}
> 
>  
> 
>  
> 
> Then error occur!
> 
> Error: operands mismatch -- statement `movm.l #0x3f3c,-(%sp)' ignored
> 
>  
>  
> Thanks
>  
> Best Regard!
>  
> Joey
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org

-- 
------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     gerg at snapgear.com
SnapGear -- a CyberGuard Company            PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com



More information about the uClinux-dev mailing list