Hello,
You can use inline assembly function in your C code,
For example the following BSP_GPIO_SetBit(ADDR, Bit) call in your C code will be replaced at compilation by the bset instruction.
//-----------------------------------------------------------------------------------------------------------------------------------//
// Add the following functions in a Header File to use them
//-----------------------------------------------------------------------------------------------------------------------------------//
// Set Bit Bit_P at Address Adr_P
inline asm void BSP_GPIO_SetBit(vuint8 *Adr_P:__A0, int Bit_P:__D0) { bset.b d0,(a0) }
// Clear Bit Bit_P at Address Adr_P
inline asm void BSP_GPIO_ClearBit(vuint8 *Adr_P:__A0, int Bit_P:__D0) { bclr.b d0,(a0) }
// Toggle Bit Bit_P at Address Adr_P
inline asm void BSP_GPIO_ToggleBit(vuint8 *Adr_P:__A0, int Bit_P:__D0) { bchg.b d0,(a0) }
// Read Bit Bit_P at Address Adr_P (Return True/False in D0)
inline asm int BSP_GPIO_ReadBit(vuint8 *Adr_P:__A0, int Bit_P:__D0):__D0 { btst.b d0,(a0); sne.b d0; andi.l #1,d0 }
//-----------------------------------------------------------------------------------------------------------------------------------//
I Hope this helps..
Bye
<< Freescale MCF5234/35 with CodeWarrior 6.4>>