void broadcast(int N_cycles)
{
unsigned int portvalue;
...
}
...the variable
portvalue is assigned to a pair of registers.
PORTB=portvalue;
...the least significant eight bits of
portvalue are written to the I/O register for PORTB.
ASM_INC(portvalue);
...which becomes...
asm volatile ("inc %0" : "=r" (portvalue) : "0" (portvalue))
...which becomes something like...
asm volatile ("inc r24")
...which just increments the value in the register used to store the least significant eight bits of
portvalue.
The whole thing is a silly replacement for this (no assembly required)...
void broadcast( int N_cycles )
{
uint8_t portvalue;
for ( int i=0; i < N_cycles; i++ )
{
portvalue = 0;
do
{
PORTB = portvalue;
++portvalue;
}
while( portvalue < 255 );
}
}