Jump to content

Martin Charlwood

Members
  • Content Count

    1
  • Joined

  • Last visited

Posts posted by Martin Charlwood


  1. Try using btfss _status,Z

    status is a variable memory mapped to a register to access variables from the assembler you have to proceed the variable name with an underscore.

     

    Best Regards.

    Martin

     

    Hi All:

    I am writing a simple assembly time delay routine and the only line that will NOT compile is the conditional. If have tried every permutation to try and get it to go, but no luck...compiler output follows code snipet.

     

    void ms_delay( void )

    {

    asm

    {

    movlw 0xE6 ; 230 decimal

    _dly1:

    nop

    nop

    nop

    nop

    nop

    nop

    nop

    nop

    nop

    addlw 0xFF

    BTFSS STATUS,Z

    goto _dly1

    return

    }

    }

     

    The compiler output is:

     

    Building...

    BoostC Optimizing C Compiler Version 6.96 (for PIC16 architecture)

    failure

    C:\PIC Projects\16F690\BoostC\Phone\Time Delay\Time Delay.c(202): error: error in built-in assembly

    C:\PIC Projects\16F690\BoostC\Phone\Time Delay\Time Delay.c(203): error: jump to undefined label

    "C:\Program Files\SourceBoost\boostc_pic16.exe" "Time Delay.c" -t PIC16F690

    Exit code was 1.

    Removing target: Time Delay.obj

    Done

     

    When I comment the conditional line it compiles! Any thoughts?

    Thanks,

    Craig

×