int in registers

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was trying to get a int into a register pair.
How is that done?
All I can find is how to put a char into a register

register char counter asm("r5");
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
register int counter asm("r4");

It will allocate r4 and r5.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

> It will allocate r4 and r5.

That applies to global register variables.

For local ones, `counter' will be allocated to r4/r5 if it's used in a asm statement. (Note it's just an if, not an iff :-))

avrfreaks does not support Opera. Profile inactive.