Assembly problem using wavrasm.

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

This is some code for an oscillator I posted in an earlier thread that would not run. I followed some corrections suggested here and I now have a working oscillator.

 

.include          "tiny2313def.inc"

 

start:     ldi    r16, 0b11111111

            out   ddrb, r16

            out   portb, r16

 

            ldi    r17,  0b00000000

            out portb, r17

            

            rjump start

 

I have been reading some of the tutorials on this site and it suggests the use of the wavrasm assembler. It looked to be a good thing since the editor and assembler were in one software package. I downloaded it and gave it a try. The code shown above works fine with avrasm2 but it produces an error 

when I assemble with wavrasm. The error message is    tn2313def.inc  file access error. I have a copy of the tn2313def.inc file the same folder that wavrasm is installed in so I don't understand why it would produce this error.

 

 

Thanks for any help,

Roger

 

 

 

This topic has a solution.
Last Edited: Mon. Sep 2, 2019 - 04:37 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why would you use anything but Atmel's avrasm2?

 

BTW you can't mean "rjump"?? the opcode is "RJMP"

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

Mopar_512 wrote:
I have a copy of the tn2313def.inc file the same folder that wavrasm is installed in so

Shouldn't header files be in the same directory as the source files if double quoted?

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

/quote]

Shouldn't header files be in the same directory as the source files if double quoted?

 

Jim

 

 

wavrasm and the source files and the include "tiny2313def.inc files are all in C:\ wavrasm directory. I have tried the entire path name C:\wavrasm\tiny2313def.inc and this didn't work either.

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

clawson wrote:

Why would you use anything but Atmel's avrasm2?

 

BTW you can't mean "rjump"?? the opcode is "RJMP"

This is working code. It is correct in the actual source code editor.

Last Edited: Mon. Aug 19, 2019 - 11:24 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know if this would be relavant or not but I have wavrasm installed on an XP machine.

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

It doesn't matter about the XP machine. Assemblers are simple programs.  In fact, they were the first simple programs on the first computers.

 

"The code shown above works fine with avrasm2 ..."    Then use avrasm2.   It's free, it's documented, it works, it works quickly, it loads quickly, it tells you more or less what error that you made.  Count your blessings. 

 

Try having a copy of tn2313def.inc in the same folder as the source code.   If that doesn't work then copy-and-paste the entire contents of tn2313def.inc before your first line of code.  It's a tiny file.  It helps for beginners to have all the code in one file.  And besides, you are only using two lines from the tn2313def.inc file: the lines that define the "ddrb" and "portb" labels.

 

If your code assembles with the last line being "rjump start", then it is not assembling in the way that you think that it is, because this should trigger an error.  Perhaps it hasn't reached this line before it stopped assembling due to the file access error.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I thought the wavrasm would be a good one to try since it is recommended in the Freaks tutorials. What I liked about it was the editor and assembler were in one package. This does make it easier and quicker to use. However it does not seem to be designed to use an include file. When I  quit using the include header and just went to defining every thing with equates it would assemble correctly. I am back to the avrasm2 now anyway.

 

Fyi the rjump that seemed to attrack so much attention was a typo error that I did in a manual code copy over. My code is assembled on a different machine than what I use to browse Freaks and I cannot copy and paste code on Freaks.

 

Anyway problem solved.

 

Thanks,

Roger

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

Mopar_512 wrote:
manual code copy over.
which is the exact reason no one should ever do that. God invented Ctrl-C, Ctrl-V for a reason!

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

That does not work on two unconnected computers.

 

Thumb drive is a more appropriate tool.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net