pic label in inline assembler problem

Help
Editor
2005-02-26
2013-03-12
  • Editor

    Editor - 2005-02-26

    there is a way to define a label inside an inline assembler code?

    i tried with (reading manual at http://sdcc.sourceforge.net/doc/sdccman.html/node79.html\)

    unsigned char count;
    unsigned char count2;

    void delay_us(char d) {
      count = d;

    _asm

    0001$:
      movlw 20
      movwf _count2
    0002$:
      nop
      nop
      decfsz _count2, f
      goto 0001$
      decfsz _count,f
      goto 0002$
    _endasm;
    }

    and the error was
    # sdcc -mpic14 -p16f84 test.c
    Processor: 16f84
    Error while parsing peep rules (check peeph.def)
    Line:   goto 0001$
    Token: '$'

    so i tried with others label name
    #sdcc -mpic14 -p16f84 test.c
    Processor: 16f84
            GOTO    inner
    ERROR: LinkFlow, branch instruction doesn't have label
            GOTO    out
    ERROR: LinkFlow, branch instruction doesn't have label
            GOTO    inner
    ERROR: LinkFlow, branch instruction doesn't have label
            GOTO    out
    ERROR: LinkFlow, branch instruction doesn't have label

    and the asm about this code was
            MOVLW   0x14
            MOVWF   _count2
            NOP
            NOP
            DECFSZ  _count2,F
            GOTO    inner
            DECFSZ  _count,F
            GOTO    out
    without no-one label

    how can i do?

     
    • Vangelis Rokas

      Vangelis Rokas - 2005-03-23

      Try compiling with --no-peeps command line, so
      peep codes aren't parsed...

      Vangelis

       

Log in to post a comment.