I'm working with avr-as and trying to load the word address of a function into a register pair. I am getting the byte address. Does anyone know the syntax to do this?
Below is my function "spin". Say it's byte address is 0x240. Then I want to load 0x120 into r23:r22. The code below is loading 0x240 into r23:r22.
.section .text .type spin,function spin: nop rjmp spin ... ldi r22,lo8(spin) ldi r23,hi8(spin)