avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Why only registers 18-31?


From: Jason Kyle
Subject: Re: [avr-gcc-list] Why only registers 18-31?
Date: Sun, 23 Dec 2001 10:34:20 +1300

At 20:39 21/12/2001 -0800, you wrote:
I have noticed that avr-gcc uses registers 18-31 for most of its work, and registers 0-1, but seems to ignore the other registers 2-17, though they are available. The avr-gcc register usage FAQ seems to confirm this. I also notice that avr-gcc-generated assembler code spends a little bit of its time shuffling these registers around, which seems like it uses up a few processor cycles, which might be saved if it had the other registers available to use.

Is there some reason why avr-gcc only uses 18-31 for most of its work? Is there a way to get avr-gcc to use the rest of the registers? Would that even be a worthwhile thing to do or would it cause other problems? My apologies if this is a dumb question; I'm fairly new to microcontrollers.

Certain opcodes can only use the upper 16 registers, for example a load immediate instruction (LDI Rd,K). Have a look through the instruction set documentation from Atmel. A while back someone made a big table of all the instructions which helps in understanding some of those why Atmel did this and that questions.

Cheers,

Jason Kyle

PS You post arrived as an attached pgp file, please post plain text without attachments.


Thanks!

- -ken




reply via email to

[Prev in Thread] Current Thread [Next in Thread]