Yahoo Groups archive

AVR-Chat

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

Message

Re: [AVR-Chat] Re: Saving PRR in assembler

2013-02-27 by Philippe Habib

Thank you.  That's good to know about the address range.  PRR is at 0x64 according to the datasheet.

----- Original Message -----
From: "Don Kinzer" <dkinzer@gmail.com>
To: AVR-Chat@yahoogroups.com
Sent: Wednesday, February 27, 2013 3:48:11 PM
Subject: [AVR-Chat] Re: Saving PRR in assembler

--- 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





------------------------------------

Yahoo! Groups Links

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.