Menu

Problem with avr asm

Help
2010-08-23
2013-05-30
  • Nobody/Anonymous

    I compiled a simple gcbasic program for atmega128:

    _____________________________

    #chip mega128, 16

    var1 = 100
    var2 = 2
    var3 = var1*var2
    ____________________________

    All ok, but when i try generate .hex with avra (linux) i have lot of errors of two types:

    pru.asm(11) : Error   : Unknown mnemonic/macro: #define
    

    The error comes from here:
    _______________________________

    ;SREG bit names (for AVR Assembler compatibility, GCBASIC uses different names)
    #define I 7
    #define T 6
    #define H 5
    #define S 4
    #define V 3
    #define N 2
    #define Z 1
    #define C 0
    ______________________

    pru.asm(30) : Warning : r27 is already assigned to 'XH'!
    

    having a look to asm file looks that some registers are asigned several times to diferent variables:

    __________________________________

    ;Register variables
    .DEF SysWaitTempUS=r27
    .DEF SysWaitTempUS_H=r28
    .DEF SysWaitTemp10US=r27
    .DEF SysWaitTempMS=r29
    .DEF SysWaitTempMS_H=r30
    .DEF SysWaitTemp10MS=r31
    .DEF SysWaitTempS=r31
    .DEF SysWaitTempM=r27
    .DEF SysWaitTempH=r28
    …….
    ……..
    ______________________________

    Is this a problem in the asm generated by GcBasic or is an avra problem?

    I'm using: Great Cow BASIC (0.9 4/7/2010)
    But same thing in previous versions.

    Thanks.

     
  • Nobody/Anonymous

    Ok, problem solved.

    Just using GcBasic internal assembler all works fine.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.