IAR Assembler & mega128

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

Hi everyone

I have a problem with IAR assembler and mega128 CPU

Here is a very simple example:

-------------------Begin code-------------------
#include "iom128.h"

RSEG CODE

PUBLIC main

main:
RJMP main

END
--------------------End code--------------------

When I assemble this file I receive a lot of errors:

Making pippo.s90
iom128.h (90) : Error[40]: Bad instruction
iom128.h (91) : Error[40]: Bad instruction
iom128.h (92) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (92) : Error[40]: Bad instruction
iom128.h (93) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (93) : Error[40]: Bad instruction
iom128.h (94) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (94) : Error[40]: Bad instruction
iom128.h (95) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (95) : Error[40]: Bad instruction
iom128.h (96) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (96) : Error[40]: Bad instruction
iom128.h (97) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (97) : Error[40]: Bad instruction
iom128.h (98) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (98) : Error[40]: Bad instruction
iom128.h (99) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (99) : Error[40]: Bad instruction
iom128.h (100) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (100) : Error[40]: Bad instruction
iom128.h (101) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (101) : Error[40]: Bad instruction
iom128.h (102) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (102) : Error[40]: Bad instruction
iom128.h (103) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (103) : Error[40]: Bad instruction
iom128.h (104) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (104) : Error[40]: Bad instruction
iom128.h (105) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (105) : Error[40]: Bad instruction
iom128.h (106) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (106) : Error[40]: Bad instruction
iom128.h (107) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (107) : Error[40]: Bad instruction
iom128.h (108) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (108) : Error[40]: Bad instruction
iom128.h (109) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (109) : Error[40]: Bad instruction
iom128.h (110) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (110) : Error[40]: Bad instruction
iom128.h (111) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (111) : Error[40]: Bad instruction
iom128.h (112) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (112) : Error[40]: Bad instruction
iom128.h (113) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (113) : Error[40]: Bad instruction
iom128.h (114) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (114) : Error[40]: Bad instruction
iom128.h (115) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (115) : Error[40]: Bad instruction
iom128.h (116) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (116) : Error[40]: Bad instruction
iom128.h (117) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (117) : Error[40]: Bad instruction
iom128.h (118) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (118) : Error[40]: Bad instruction
iom128.h (119) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (119) : Error[40]: Bad instruction
iom128.h (120) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (120) : Error[40]: Bad instruction
iom128.h (121) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (121) : Error[40]: Bad instruction
iom128.h (122) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (122) : Error[40]: Bad instruction
iom128.h (124) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (124) : Error[40]: Bad instruction
iom128.h (126) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (126) : Error[40]: Bad instruction
iom128.h (127) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (127) : Error[40]: Bad instruction
iom128.h (128) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (128) : Error[40]: Bad instruction
iom128.h (129) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (129) : Error[40]: Bad instruction
iom128.h (130) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (130) : Error[40]: Bad instruction
iom128.h (131) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (131) : Error[40]: Bad instruction
iom128.h (132) : Error[42]: Duplicate label:'SFR_B_BITS_EXT'
iom128.h (132) : Error[40]: Bad instruction

Total number of errors: 80
Total number of warnings: 0

The problem seems to be related with extended io space because if I write

#include "iom103.h"

it works ok.

Does anyone know how to correct the problem

Many thanks

Have a nice day

Pippo

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

ATM128 is shipped in "ATM103 compatibility mode". Check the fuses.

admin's test signature
 

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

This has nothing to do with fuses. Do you have the "enhanced core" option checked? It is under options-general-target.

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

Hi Robert

Yes, the option is checked.

Have a nice day

Pippo

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

I am sorry that my comment about the fuses was abrupt. Andreas had a good thought, but as I understand it, the problem is before connecting with the hardware. The fuses might be the next problem, but not the current one.

I have always found the IAR technical support people to be helpful. Call 650-287-4250 in the US.

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

Make sure that the iomega128.h is found, otherwise it will not recognize certain lines and / or names.
Instead of using #include "iom128.h" use #include "d:\path\iom128.h".
using the full pathname might solve it.

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

Hi evryone,

I found the solution: it seems that in the iomacro.h file included in the iom128.h file one #define is missing in the asm section. I added the two lines:

#define SFR_B_BITS_EXT(_NAME,_ADDR,_A,_B,_C,_D,_E,_F,_G,_H)\
sfrb _NAME = _ADDR

and it works ok.

Many thanks

Have a nice day

Pippo