Search code examples
assemblysyntax-erroravr

Syntax error, unexpected '\n' in assembly language


I am trying to build an old project that I did not write and am not very familiar with. It's being built using AVR Studio 4 and I'm programming an ATMEL AT90s8535. I realize this is an old chip and an old way of doing things but it is for an old product that we do not want to dump a bunch of time into changing the code over to C language. I am getting an error that says "syntax error, unexpected '\n'". I have NO IDEA what I'm missing here because there is no '\n' in the code. Here is my code..Any idea of what needs to be done??

Thanks, Tucker

FreqCalcAndTransmit:
    rcall       RangeCheck      ;Range Check takes care of changing
    ldi     r17, 0xFF       ; Step sizes also
    cpsne       r23, r17
     ret
    rcall       VCODetermine

    CLR     DIVIDENDREG0, 
    lds     DIVIDENDREG1, hexResult0
    lds     DIVIDENDREG2, hexResult1   ;Divide the freq by the StepSize
    LDS     DIVIDENDREG3, hexResult2

    lds     DIVISORREG0, STEPVarHI
    lds     DIVISORREG1, STEPVar
    rcall       UDVD32

    CLR     r17
    cpsne       REMAINDERREG0, r17  ;Make sure the freq is divisible by 
     rjmp       FreqDivisible       ; the step size
    ldi     r23, 0xFF
    ret

Solution

  • Delete the trailing comma. CLR only takes a single argument. PS: the \n is the newline, which is unexpected due to the comma signalling another argument is coming. – Jester Jun 25 at 14:57