Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: Saving PRR in assembler

2013-02-27 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, Philippe Habib <phabib@...> wrote:
> The mov instruction only seems to like "real" registers
> and the command mov r17,PRR does not work.
The PRR register is in the I/O space.  If the address is 0x31 or less, you can use the IN and OUT instructions; otherwise, you must use LDS and STS to read/write the register.  It is useful to use one of the macros that yields IN/OUT or LDS/STS depending on the port referenced - especially so if you're writing code to run on several different devices where a particular register is in the IN/OUT range on some devices but not so on others.

Often, it is instructive to write some C code for some particular functionality and then examine the code the compiler generates.  How one does that depends on which C compiler is being used.

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.