cancel
Showing results for 
Search instead for 
Did you mean: 

c write into asm

developer2
Senior
Posted on November 12, 2013 at 22:41

Hi All,

please somebody help me to write this c code into asm:

void EXTI9_5_IRQHandler(void)

{

  /* Clear the EXTI line pending bit */

  //EXTI_ClearITPendingBit( EXTI_Line8 );

  EXTI->PR = EXTI_Line8;

  NVIC->ICER[ EXTI9_5_IRQn >> 0x05] = (uint32_t)0x01 << ( EXTI9_5_IRQn & (uint8_t)0x1F);

  uint32_t i32=ADC_BUFFER_FULL_LEN; // actual value 20001

  ADC_Buffer_ptr1=(uint8_t *)ADC_Buffer;

  do

  {

    *(ADC_Buffer_ptr1++)=*(((uint8_t *)&(GPIOF->IDR))+1); // GPIO_Pins [15:8] into Buffer

  }

  while( (i32--) > 0 );

}

compiler is unrolling ''while'' into 7 steps always and i think that if the code will be written in asm then will not be unrolled ...

Thanks for all replies,

Kind regards

2 REPLIES 2
Posted on November 12, 2013 at 23:03

please somebody help me to write this c code into asm:

I've got some leaves that need raking and tyres that need changing. This should compile fairly cleanly

void EXTI9_5_IRQHandler(void)
{
uint8_t *p = (uint8_t *)ADC_Buffer;
volatile uint8_t *q = (((uint8_t *)&GPIOF->IDR) + 1);
int i = 20000; // or do you need 20001 bytes?
/* Clear the EXTI line pending bit */
EXTI_ClearITPendingBit( EXTI_Line8 );
while(i--)
*p++ = *q;
}

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
developer2
Senior
Posted on November 12, 2013 at 23:14

well, it isn't unrolled,thank you very much ...