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
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
That does not look like Pic Basic. Maybe protron?
Dave
Always wear safety glasses while programming.
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...
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 16F877Code:__16F876 00000001
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.
What does this line do?
Will it help my program?Code:DEFINE TGIF MISTER_E
Dave
Always wear safety glasses while programming.
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.
OK, I will have to remember that![]()
Dave
Always wear safety glasses while programming.
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.
Well yes and no, it depend how you define your variable
in asm, you will access MyVar as _MyVar, but AnotherVar will remain AnotherVarCode:MyVar var BYTE AnotherVar var BYTE SYSTEM
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.
Bookmarks