Assembler 2

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

I guess not 100% on forum topic. I was wondering if the assember that comes with Studio 4.12 can be posted as a stand alone program somewhere and whether it is backward compatible with Studio 4.11. The reason for this is that I don't quite want to donload the entire 45Mb yet until most bugs are ironed out...AND... I'm perfectly happy with Studio 4.11 as it finally works almost 100% of the times :wink: I have tried a few of the MK2 assemblers but keep on reverting to V 1.75.6, so I could give the new one a try and see what happens.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:
I guess not 100% on forum topic. I was wondering if the assember that comes with Studio 4.12 can be posted as a stand alone program somewhere and whether it is backward compatible with Studio 4.11. The reason for this is that I don't quite want to donload the entire 45Mb yet until most bugs are ironed out...AND... I'm perfectly happy with Studio 4.11 as it finally works almost 100% of the times :wink: I have tried a few of the MK2 assemblers but keep on reverting to V 1.75.6, so I could give the new one a try and see what happens.

Hi John,

To answer the second question first: Yes, the assembller shipped with Studio 4.12 is backward compatible (although this is not a configuration we actively test). The only compatibility issue I know about occurs if you have source files with more than 65000 lines, in that case the new assembler will produce an extended object format that Studio 4.11 does not support.

We don't provide a separate assembler package for public download, but I have attached the latest asssembler executable here (v. 2.1.1).

--
Roland

Attachment(s): 

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

Quote:
source files with more than 65000 lines

I don't think so :-) Thanks for that. I'll give it a good try in the next few weeks. You may remember that there were some problems which I reported with the last (2?) versions in using things like # or * as characters i.e. cpi r16,'#' would flag as an error with V2xx but not with V1xx

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

First bug/incompatibility. The following line assemble OK with V1.75:

.equ SUB =0x1A ;^Z Substitute (this is part of an equate table for all control chars)

With V2 I get the error:

c:\avr\lib\ASCII_table.asm(33): error: Attempt to redefine keyword 'sub'

More bugs

C:\Program Files\Atmel\AVR Tools\AvrAssembler\Appnotes\4433def.inc(162): error: Attempt to redefine keyword 'or'

This is a Studio include file!

This next one I have reported before.

C:\AVR\Projects\Q_station_master\q_station_master.asm(1149): error: Illegal reuse of instruction 'adc' as label

My code
.....

;$00E
rjmp ADC ;ADC Conversion Complete Handler (exactly as the PDF)
....

service routine:
ADC:
in save_sreg,sreg ;Save Status register
etc.

More work required :cry: Back to V1.75

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

By the way aI cant see how ANY program will assemble correctly as all ...inc files contain

.equ RXC =7
.equ TXC =6
.equ UDRE =5
.equ FE =4
.equ OR =3 ******************

It brings the error

C:\Program Files\Atmel\AVR Tools\AvrAssembler\Appnotes\4433def.inc(162): error: Attempt to redefine keyword 'or'

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

OK I can see one problem, the assembler is picking up the .inc file for V1xx assembler as V2xx assembler has change OR to DOR so when:

.include "8535def.inc"

The assembler should know from which directory it is supposed to pick the .inc files from...which it does not.

I expect a few extra bytes of code in my Studio 4.12 for my hard work :-)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:
First bug/incompatibility. The following line assemble OK with V1.75:

.equ SUB =0x1A ;^Z Substitute (this is part of an equate table for all control chars)

With V2 I get the error:

c:\avr\lib\ASCII_table.asm(33): error: Attempt to redefine keyword 'sub'


Assembler 2.x doesn't allow you to use reserved words (like instructions) as user symbols. This is a documented compatibility issue.

See AVR Tools Help sextion "AVR Assembler 2 - AVR Assembler 2 Syntax" for an eample explaining why this may be a Good Thing(TM).

Because the assembler by default is not case sensitive, 'SUB' and 'sub' are considered equal.. You can get around this either by using a different name, or by setting the assembler to be case sensitive (-c option) but that may break other things if you are not totally consistent about the use of upper/lower case.

js wrote:
C:\Program Files\Atmel\AVR Tools\AvrAssembler\Appnotes\4433def.inc(162): error: Attempt to redefine keyword 'or'

This is a Studio include file!


Yes, but it's the wrong one! Assembler 2 has its own include files, these are located in C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes\. You probably have set up an include path to the old files in assembler options, if you remove that AVRASM2 will use the correct ones automatically.
js wrote:
This next one I have reported before.

C:\AVR\Projects\Q_station_master\q_station_master.asm(1149): error: Illegal reuse of instruction 'adc' as label

My code
.....

;$00E
rjmp ADC ;ADC Conversion Complete Handler (exactly as the PDF)
....

service routine:
ADC:
in save_sreg,sreg ;Save Status register
etc.


This is the same issue as the first bug ('adc' is an instruction).. And yes, the example in the data sheet is not correct.

All that is required to remedy this is to name the label something else than ADC, or again use the -c option.

js wrote:
More work required :cry: Back to V1.75

It's your choice to make. Keep in mind that it's unsupported (that means it will not support new devices, bugs will not be fixed, etc).

I'm sorry, but I don't think we ever will change this aspect of AVRASM2. Sometimes, new version of tools force changes in source code. This inconvenience has to be weighed against the risk and inconvenience of using an unsupported tool.

--
Roland

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

Quote:
the example in the data sheet is not correct.

Thank you :-)

Quote:
Assembler 2 has its own include files,

As you can see from the above I picked that point up, but I'm not including a path at all:

.include "8535def.inc"

So studio is setting the default path to the wrong \Appnotes\ path when I'm using V2 assembler, nothing disastrous but it could be fixed I guess.

If it hurts you I'll use V2 :-) It only comes up with a few errors and yes I can fix my code to stop them....I 'm only doing this because you did a great job in fixing 'issues' with the ICE200 in Studio 4.11. :wink:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:

Quote:
Assembler 2 has its own include files,

As you can see from the above I picked that point up, but I'm not including a path at all:

.include "8535def.inc"

So studio is setting the default path to the wrong \Appnotes\ path when I'm using V2 assembler, nothing disastrous but it could be fixed I guess.


This really surprises me.

In the Assembler options window (Project->Assembler Options), you'll se that if you select Assembler1, the "additional include path" field will be set up with C:\Program Files\Atmel\AVR Tools\AvrAssembler\Appnotes, that setting disappears when selecting Assembler2 because Assembler2 has the standard include directory built-in.

The built-in path used by Assembler 2 is stored in the registry in

HKEY_LOCAL_MACHINE\SOFTWARE\Atmel\AVRTools\AvrAssembler2\IncludePath

you can check if that is correctly set up.

Note that if you specify an additional include directory for Assembler2 in Studio's assembler options, that directory will be searhced before the built-in directory.

Hope this helps,
--
Roland

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

Quote:
that setting disappears when selecting Assembler2

It stays the same for both. Using Studio 4.11, buid 406, SP2 (it may have been fixed in SP3 ??)

ps I did a 'restore default' and it fixed it, it now switches between the 2 paths.

pps I re run a couple of projects which have been using V1.75 assembler and the same problem of having the path stuck reappeared, clicking 'restore default' again fixed it.

By the way using the -c is not an option for the time being as all bits definitions, ports etc are in upper case in the .inc file whilst I use lower case throughout :cry: in my code. Perhaps in new projects...

I have changed ADC to _ADC to fix the error with the ints vectors.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly