Converting AVR assembly to machine code - addressing registers?
You have the op code for ANDI wrong, it's 0111 KKKK dddd KKKK. Using the assembler, I get 0x7120 as the machine code for ANDI r18, $10, which is 0111 0001 0010 0000.

0010 for dddd is 2, which represents r18, because it's the third register from r16 to r31. Only the upper 16 registers are valid for the ADDI instruction. 0000 is r16, 0001 is r17, and 0010 is r18.