Question: MCF5275 parameter passing assembly in C code

"Andy Gabler" <[email protected]> Mon, 17 Mar 2008 18:32:33 -0400
Newsgroups gmane.comp.hardware.motorola.microcontrollers.coldfire
Message-ID <[email protected]>
Greetings all,

I am working on an FIR filter to implement on the MCF5275.  When I
compile my FIR filter from C it uses the "mul" command rather than the
"mac" command to implement the multiply accumulate stage of the FIR
filter.  I would like to place some assembly code inline to force the
use of the "mac" command.

This is what I have been playing with and would like to do; however, I
do not know the proper way to define which register my variable in C
(like "itap") gets stored in so I can reference it in my "mac"
instruction.  Can anyone shed any light on how to do this?

	//sum += taps[i] * delayLine[i];
	itap = taps[i];
	iDelayLine = delayLine[i];		
	asm ("move.l _itap, %d0\n\t"
		"move.l _iDelayLine, %d1\n\t"
		"mac.w %d0.l, %d1.l 00, %ACC0");
	delayLine[i+1] = delayLine[i];

Also do any of you have any idea why the compiler comes up with this error:

"/tmp/ccjIiru2.s Error: syntax error -- statement `mac.w %d0.l,%d1.l
00,%ACC0' ignored"

concerning my mac instruction?

Thank you!

-andy
---
[email protected]              Send a post to the list.
[email protected]        Join the list.
[email protected]    Join the list in digest mode.
[email protected]     Leave the list.