plaese help check what is mean of this sentence,appreciate you


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2008
    Posts
    7

    Smile plaese help check what is mean of this sentence,appreciate you

    I read a demo program , have this in the front of it, what is that mean?

    DEFINE __16F876 1


    "_ " seemed have some special function, related to the address of a varity? what about the double "_" meaning?

    great thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    That does not look like Pic Basic. Maybe protron?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    NAH certainely not Proton (PDS) they use DEVICE = 16F876.

    I think this line have been taken somewhere on the forum. No real use in PBP unless you use it on ASM level.

    If you use MPASM it already do that. Start a blank project and compile it, open the .LST file and you'll discover...
    Code:
    __16F876                          00000001
    Ok then what to do with it? Use MPASM AND paste the following line at the top of your code and try to compile for another pic than 16F877

    Code:
    asm
        IFNDEF __16F877
            ERROR "OPEN YOUR EYES.. YOU MUST SELECT 16F877 IN THE DROP MENU..."
            ENDIF
    ENDASM


    Still useful for conditional code compile.. ex if the PIC=16F877 do this, if it 18F452 do that etc etc etc.

    You can define everything you want the way you want (almost)

    DEFINE TGIF MISTER_E
    DEFINE DOODAH_DOODAH 2

    and use it later in asm level.
    Last edited by mister_e; - 14th April 2008 at 09:59.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    What does this line do?
    Code:
    DEFINE TGIF MISTER_E
    Will it help my program?
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Depending the amount of cash, beer or freebies you assign to MISTER_E variable, it could help or totally ruin your whole life
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    OK, I will have to remember that
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Apr 2008
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Great Thanks

    I am sure this sentence is a part fo picbasic, withi ASM used.

    still I do not know the function of "-"

    "_ " seemed have some special function, related to the address of a varity? what about the double "_" meaning?

    seemed always used as "_myvar" is ASM, and "myvar" in basic, they are the same value.

  8. #8
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Well yes and no, it depend how you define your variable
    Code:
        MyVar var BYTE
        AnotherVar var BYTE SYSTEM
    in asm, you will access MyVar as _MyVar, but AnotherVar will remain AnotherVar

    Why the double underscore? I can't tell for sure, maybe just to avoid some double definition.. not much. _ is just another character.

    You can't define a variable name which begin with a number though.
    <hr>
    i found an explanation... well sort of
    http://mail.python.org/pipermail/pyt...ry/019711.html
    Last edited by mister_e; - 15th April 2008 at 16:12.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. TMR1 external LP xtal setup check
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th October 2009, 18:11
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  3. PIC16F877A - Timer0 won't interrupt
    By WishMaster^ in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 25th April 2007, 08:25
  4. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  5. Even Parity Check, How?
    By Mark Scotford in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th January 2005, 09:21

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts