Hi
You may find that this routine is in an assembly file somewhere since the Coldfire has a specal assembler instruction that can be used to reverse bytes very efficiently:
CodeWarrior assembler is:
_byte_rev:
byterev.l d0
rts
GCC assembler may be:
byte_rev:
move.l 4(%SP),%D0
byterev.l %D0
rts
If not, it can also be replaced by a macro similar to the following:
#define fnLE_add(x) ((x >> 24) | ((x >> 8) & 0x0000ff00) | ((x << 8) & 0x00ff0000) | ((x << 24) & 0xff000000))
Regards
Mark
www.uTasker.com