Compile Error

Ian Caddy ianc at goanna.iinet.net.au
Fri Aug 26 02:16:12 UTC 2005


Hi Mike,

On Coldfire processors, you can not have an immediate bit number AND an 
absolute address at the same time.

If you look at the Programmers Reference manual, it is not obvious, but 
for the BCLR (and BSET) instructions, it supports different addressing 
modes for the "Bit Number Static, specified as immediate data" (your 
case) and "Bit Number Dynamic, specified as a register".

In the first case (Bit number static):
bclr.b #<data>, Dx
bclr.b #<data>, (Ax)
bclr.b #<data>, (Ax)+
bclr.b #<data>, -(Ax)
bclr.b #<data>, (d16,Ax)

Note all the rest of the addressing modes in the table show a dash for 
Mode, which means they are not allowed.

In the second case (bit number dynamic):
bclr.b Dx, Dx
bclr.b Dx, (Ax)
bclr.b Dx, (Ax)+
bclr.b Dx, -(Ax)
bclr.b Dx, (d16,Ax)
bclr.b Dx, (d8,Ax,Ai)
bclr.b Dx, (xxx).W
bclr.b Dx, (xxx).L

So, you will have to do something like Keith suggested about putting the 
destination address into an Address register and using that.

I hope this helps.

regards,

Ian Caddy




Mike Bertosh wrote:
> Ian,
> 
>  .BITLOOP2: BCLR.B   #SCL,PORTQS 
>           |ROL.B    #1,d0 
>           BCS      .HIGHBIT2
> .LOWBIT2: BCLR.B   #SDA,PORTQS
>           BRA      .SKIP2
> .HIGHBIT2:BSET.B   #SDA,PORTQS
> 
> m68k-rtems4.7-gcc --pipe -B/opt/rtems/rtems-4.7/bin/m68k-rtems4.7/mcf5235/lib/ -specs bsp_specs -qrtems   -m528x    -m528x     -c  -DASM -o o-optimize/eecode2.o eecode2.S
> eecode2.S: Assembler messages:
> eecode2.S:122: Error: operands mismatch -- statement `bclr.b #5,0xFFFC15' ignored
> eecode2.S:125: Error: operands mismatch -- statement `bclr.b #6,0xFFFC15' ignored
> eecode2.S:127: Error: operands mismatch -- statement `bset.b #6,0xFFFC15' ignored
> 
> Hopefully this will help you out, let me know if there is any other information I can 
> supply that will help.
> 
> -Mike
> 
> On 25 Aug 2005 at 9:55, Ian Caddy wrote:
> 
> 
>>Hi Mike,
>>
>>Maybe you could provide us with a little more information, such as which 
>>peice of code is generating the error.
>>
>>It is quite hard to help when you have provided no details.
>>
>>regards,
>>
>>Ian Caddy
>>
>>
>>Mike Bertosh wrote:
>>
>>>Aaron,
>>>
>>>I have looked into your suggestion but the addressing modes I am using seem to 
>>>exist. Any other ideas? Thanks.
>>>
>>>On 24 Aug 2005 at 14:28, Aaron J. Grier wrote:
>>>
>>>
>>>
>>>>On Wed, Aug 24, 2005 at 04:52:16PM -0400, Mike Bertosh wrote:
>>>>
>>>>
>>>>>I am compiling some assembly code for a Coldfire MCF5235 board. I am
>>>>>getting an error that says "Error invalid instruction for this
>>>>>architecture; needs 68000 or higher." and an error that says "Error
>>>>>operands mismatch --statement ignored". Does anyone know how I can fix
>>>>>this? Thanks for your time.
>>>>
>>>>check your assembly code.  coldfire v2 is missing some addressing modes
>>>>which exist on earlier members of the 68k family.
>>>>
>>>>-- 
>>>> Aaron J. Grier  |   Frye Electronics, Tigard, OR   |  aaron at frye.com
>>>
>>>
>>>
>>>Mike Bertosh
>>>Motion Control Systems, Inc.
>>>New River, Va
>>>540.731.0540
>>>
>>>
>>
>>-- 
>>Ian Caddy
>>Goanna Technologies Pty Ltd
>>+61 8 9221 1860
>>
>>
> 
> 
> 
> 

-- 
Ian Caddy
Goanna Technologies Pty Ltd
+61 8 9221 1860





More information about the users mailing list