user85444: ADMUX  = ADMUX | _BV(REFS);  // uncompounded bitwise OR
ADMUX |= _BV(REFS0);         // #define _BV(bit) (1 << (bit))
ADMUX |= bit(REFS0);         // #define bit(b) (1UL << (b))
bitSet(ADMUX, REFS0);        // #define bitSet(value, bit) ((value) |= (1UL << (bit)))
sbi(ADMUX, REFS0);           // deprecated assembly? 
ADMUX |= (1 << REFS0);       // shift operator
ADMUX |= (1 << 7);           // bit 7 is named REFS0
ADMUX |= 0b10000000;         // bin
ADMUX |= 0x80;               // hex
ADMUX |= 128;                // dec

*under normal 8 bit Arduino circumstances?

user7508: You already got an answer in the comments but, just to make double sure,
I tried compiling all these statements for an Uno, and they got all
translated into the exact same machine code. Well, almost: I had to do
some minor adjustments, which I believe are unrelated to the essence of
your question. Just for completeness, I changed the following:

I replaced REFS0 by REFS1: on an Uno, REFS0 is bit 6, and REFS1
is bit 7.

I replaced REFS by REFS1, as the former is not defined.

I #included <compat/deprecated.h>, otherwise I get the error
“'sbi' was not declared in this scope”.



85444: <pre><code>ADMUX  = ADMUX | _BV(REFS);  // uncompounded bitwise OR
ADMUX |= _BV(REFS0);         // #define _BV(bit) (1 &lt;&lt; (bit))
ADMUX |= bit(REFS0);         // #define bit(b) (1UL &lt;&lt; (b))
bitSet(ADMUX, REFS0);        // #define bitSet(value, bit) ((value) |= (1UL &lt;&lt; (bit)))
sbi(ADMUX, REFS0);           // deprecated assembly? 
ADMUX |= (1 &lt;&lt; REFS0);       // shift operator
ADMUX |= (1 &lt;&lt; 7);           // bit 7 is named REFS0
ADMUX |= 0b10000000;         // bin
ADMUX |= 0x80;               // hex
ADMUX |= 128;                // dec
</code></pre>
<p>*under normal 8 bit Arduino circumstances?</p>
 7508: <p>You already got an answer in the comments but, just to make double sure,
I tried compiling all these statements for an Uno, and they got all
translated into the <em>exact same machine code</em>. Well, almost: I had to do
some minor adjustments, which I believe are unrelated to the essence of
your question. Just for completeness, I changed the following:</p>
<ol>
<li><p>I replaced REFS0 by REFS1: on an Uno, REFS0 is bit 6, and REFS1
is bit 7.</p>
</li>
<li><p>I replaced REFS by REFS1, as the former is not defined.</p>
</li>
<li><p>I #included <code>&lt;compat/deprecated.h&gt;</code>, otherwise I get the error
“'<code>sbi</code>' was not declared in this scope”.</p>
</li>
</ol>
