AVR Studio will no longer accept R00, R01.. Must be R0, R1

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

Older versions would let me say:

.DEF   A = R00
.DEF   B = R01

With 4.11, I have to say:

.DEF   A = R0
.DEF   B = R1

Regards

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

Hello.
Although I agree with you, isn't it just an aesthetic issue?

Giorgos,
Regards.

I hope for nothing; I fear nothing; I am free. (Nikos Kazantzakis)

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

!!Absolutely not!!

If this was an issue with upper/lower case I could understand maybe and even then probably still not like it.

That's like defining a number via an equate of "0x110" instead of "0x0110".

Imagine the assembler giving you an error for that!

My problem is:

I have alot of old code where I say 01,02,03,04, ..., 10,11,12,... and now I have to correct this.

Second issue I have beef with this is the error it returns is not clear to explain exactly what's wrong. It gives a blanket statement to you and leaves you scratching your head because we both know "r01" and "r1" are the same!

Regards

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

Yeah, I see your point.

I also code some included generic library files, using this onomatology.
I guess I haven't yet bumped on any of those ones...

Waiting for the v4.12 installation file...

Giorgos.

I hope for nothing; I fear nothing; I am free. (Nikos Kazantzakis)

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

sxpilot450 wrote:
!!Absolutely not!!

If this was an issue with upper/lower case I could understand maybe and even then probably still not like it.

That's like defining a number via an equate of "0x110" instead of "0x0110".

Imagine the assembler giving you an error for that!

My problem is:

I have alot of old code where I say 01,02,03,04, ..., 10,11,12,... and now I have to correct this.


What you need to understand is that the register names are symbols. That means that the number part (0-31) are just part of their name, and not interpreted as numbers by the assembler. Consider: if this was otherwise, you should be able to say "r0x10" instead of r16 as well. And "r08" would not even be a valid register name, because numbers starting with 0 are interpreted as octal....

Enough of that, here's a possible workaround:

Create a file in your project directory, let us call it "regs.inc", that looks like this:

#define R00  r0
#define R01  r1
#define R02  r2
#define R03  r3
#define R04  r4
#define R05  r5
#define R06  r6
#define R07  r7
#define R08  r8
#define R09  r9

Now, open your assembler project. In the Studio menu bar, select "Project - Assembler Options". At tje bottom of the options window is a field called "Additional parameters", in that field, type the following:

-i regs.inc

That should solve it, without needing to change any code. Note: the preprocessor #defines are case sensitive, so if you use "r00" and so on in your code, you need to double up with lower-case defines, "#define r00 = r0" and so on.

sxpilot450 wrote:
Second issue I have beef with this is the error it returns is not clear to explain exactly what's wrong. It gives a blanket statement to you and leaves you scratching your head because we both know "r01" and "r1" are the same!

The error message leaves something to be desired.

--
Roland Kruse
Atmel AVR Tools

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

Or...you can always use the older assembler like I do :D (Sorry Roland I know you are trying hard :D :D )

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Thank you for your time Roland! I think I'll just adapt over whatever code I assemble in your newer Studios to make life easier now that I've found the reason for the error.

Seriously though, I would consider parsing the symbol for r00 or r01 as you used to do.

Thanks again!

Regards

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

Quote:
your newer Studios
Remember that is NOT studio as such but the assembler to which it defaults (Version 2). You can still use V1 assembler for the time being by selecting it in the Assembler option.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly