Relative Content

Tag Archive for assemblyavrgnu-assembler

AVR instructions LDS and STS 16 bit versions with GNU assembler

the AVR 8bit core instruction set includes the more efficient 16bit versions of the “load data from memory” (LDS) and “store data to memory” (STS) instructions, as opposed to the 32bit versions. As per the AVR Instruction Set Manual, the assembler syntax for the two versions is exactly identical. Obviously the assembler is meant to find out by itself if the 16bit version can be used (i.e. the address is 7bit only, and the register is one of R16:31). Only I find the GNU assembler does not. It always emits the 32bit version.