How do I convert ldi R17, 129 to machine code
The instruction "LDI R17, 129" means load the immediate data 129 into Register 17.  (Immediate data is data included in the instruction word.)

The CPU will fetch the instuction word from memory into the Instruction Register, decode the instruction, then extract the register number and immediate data, and place the immediate data in the selected register.

Note that although the AVR microcontrollers have 32 registers (0 - 31), LDI and some other instructions can only operate on registers 16 - 31, so only four bits are required to specify the register - the leading "1" is assumed.