void broadcast(int N_cycles)
unsigned int portvalue;
...the variable portvalue
is assigned to a pair of registers.
...the least significant eight bits of portvalue
are written to the I/O register for PORTB.
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 )
for ( int i=0; i < N_cycles; i++ )
portvalue = 0;
PORTB = portvalue;
while( portvalue < 255 );