Label usage

2005-03-15
2013-03-12
  • I'm trying to use Labels as manual said ( i found that manual tells to use nnnnn$ and $nnnn labes, i don't understand).
    The result is the same, compilation errors.
    This is the function that have asm embedded:

    unsigned char counter;

    void delay256()
    {
        counter = 255;

        _asm
            00001$:
            decfsz _counter, 1
            ljmp 00001$
        _endasm;
    }

    And the compilation is:

    leecher root # sdcc -mpic14 -p16f819 prueba.c
    Processor: 16f819
    Error while parsing peep rules (check peeph.def)
    Line:                 ljmp 00001$
    Token: '$'

     
    • juliuslg
      juliuslg
      2005-03-29

      Well, it seems I'm not the only one who have this problem :)

      Some precisions : When, in inline asm bloc, I try to use a label as usual in asm :

      _asm
          goto mylabel
          ;some code
      mylabel:
           ;some code
      _endasm;

      I have an error when I compile :
      " GOTO mylabel
      ERROR: LinkFlow, branch instruction doesn't have label"

      I found that very strange, so I check the .asm file generated by the compilation, then I saw that 'mylabel' was no more a label, it was just dropped out from the assembly file ! This explains the error well, so I check the manual, which explains two different ways to make labels (as jvalencia said)... And when I try with 'nnnnn$' or '$nnnnn'-like labels, then I have an error generated by the peep rules... They have some proble with the '$' character, dunno why, I check the peeph.def and I saw nothing particular with the '$'...
      Anyone have an idea about our problem ? It's kinda strange and I can't use my asm routines I've developped in C progs... I've tried everything that come to my mind, but nothing work :(

      Thank you

       
  • Jean PETILLON
    Jean PETILLON
    2009-11-03

    I have the same problem : error 103 syntax error, when i use 00010$ or
    $00010.
    Please, what is the good syntax?
    I work with SDCC vERSION 2.9.
    Thank you for help
    Jean

     
  • egyptfireman
    egyptfireman
    2009-11-03

    I have used the 00000$: synatax successfully for 8051 code. could it be a target issue?