AVR asm

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

The assembler bundled with AVR Studio gives errors when assem-
ing lines which meet the syntax requirements as listed in the
documentation. For example, with the ATtiny15 device specified,
errors occur with LD R1,Z and ST Z,R1, yet these instructions
are listed in the ATtiny15L Instruction Set Summary. Also,
SBR R16,1, CBR R16,1, and SER R16 only seem to work with
registers R16-R31, and not with R0-R15, however, Atmel makes no
reference to these instructions as being able to work with only
R16-R31. Am I doing something wrong, or is Atmel purposely confusing me to keep me on my toes? Another question - is it possible to look at the asm-generated list file while in AVR Studio? Thanks in advance for your help...

admin's test signature
 

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

Hi Dave,

Atmel is not deliberately confusing you :)

1.
The LD r1, Z and the ST, Z, r1 should work, and I was greatly surprised by your comment. I tried these two instruction lines in my assembler (the one included in AVR Studio 3.22), and did not get an error message. You may not have included the correct device file. It should be tn15def.inc. You could send me your code showing this behaviour to my support address.

2.
The behaviour you describe for the SBR, CBR and SER instructions, is normal. Only registers r16 and above can be accessed directly. Please see the detailed description in The instruction set summary on this subject.

3.
You can open the list file by choosing File->Open and selecting it after having assembled your code. There's no shortcut that I know of, though.

Morten, AVR tech. support, Atmel FAE

admin's test signature
 

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

Hi Dave,

Atmel is not deliberately confusing you :)

1.
The LD r1, Z and the ST, Z, r1 should work, and I was greatly surprised by your comment. I tried these two instruction lines in my assembler (the one included in AVR Studio 3.22), and did not get an error message. You may not have included the correct device file. It should be tn15def.inc. You could send me your code showing this behaviour to my support address.

2.
The behaviour you describe for the SBR, CBR and SER instructions, is normal. Only registers r16 and above can be accessed directly. Please see the detailed description in The instruction set summary on this subject.

3.
You can open the list file by choosing File->Open and selecting it after having assembled your code. There's no shortcut that I know of, though.

Morten, AVR tech. support, Atmel FAE

admin's test signature
 

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

hi

yes it normal that ser donk work on r0 to r15

some branch instruction donk work whit ther register

im sujest to use r16 to r 26 first for avoid problem

end for st en ld also try register r16 to r31

end if your code have no error it generete a list file

if you have problem just send me a part of your code

im check this on en reply you ..

thank
alphatronic
marc lalonde

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

Hello again mr. Bodey

I've reviewed your code and sent you an answer, but the mail bounced. I'll post it hear instead:

The ATtiny15 does only have a one-register Z pointer. Replace your 'ZL's with 'Z's, and the code compiles fine.

Morten, AVR tech. support, Atmel FAE

admin's test signature