In AVR Assembly - I want to work out the machine code representation of the following:
I know the opcode for ANDI is
0010 KKKK dddd KKKK
And I know that
r18 is the destination register (Rd), and that
$10 (16) is KKKKKKKK - my intuition thinks that I should replace
18 but that is not possible with only 5 bits (unless I'm severely missing something here...) as 18 in binary is
I'm thinking I just replace
0000 - but I just don't see how I'm meant to address register 18 with only 4 bits.
The instruction set summary says that r16…r31 can all be represented with
dddd which I would think means 4 bits also, so I know I've got something horribly wrong.
Any help would be great.
Reference: http://www.atmel.com/Images/doc0856.pdf - page 20