Motorola Coldfire delay() function

Charles Steaderman charlies at
Mon Dec 1 17:16:30 UTC 2003

I have a custom board based upon the mcf5206e Coldfire processor. I 
based my custom bsp upon the excellent mcf5206elite bsp. I would like to 
use a delay() function to signal an error via leds if a fatal error 
occurs. There is a delay(microseconds) macro included with the 
mcf5206elite bsp, but the assembly instructions that it uses are for a 
full-blown M68K, not the Coldfire processor. The delay function is as 

#define delay( microseconds ) \
  { register rtems_unsigned32 _delay=(microseconds); \
    register rtems_unsigned32 _tmp=123; \
    asm volatile( "0: \
                     nbcd      %0 ; \
                     nbcd      %0 ; \
                     dbf       %1,0b" \
                  : "=d" (_tmp), "=d" (_delay) \
                  : "0"  (_tmp), "1"  (_delay) ); \

Does anyone know Coldfire assembly well enough to supply suitable, 
replacement instructions for "nbcd" and "dbf"?

- Charlie

Charlie Steaderman
charlies at
VP Engineering
Poliac Research Corporation
Phone: 952.707.6245
Cel: 612.242.6364

More information about the users mailing list