>> I just wanted to convert between #4 and %1000 with a single line of code.
B0 = DCD 3 ‘ Sets B0 to %00001000
(see PBP manual for full details)
>> I just wanted to convert between #4 and %1000 with a single line of code.
B0 = DCD 3 ‘ Sets B0 to %00001000
(see PBP manual for full details)
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Thank you Sinoteq
I checked that out.
I think I can even do this:
Y=1 'Now Y=%00000001
x = 6
Y=Y << x
And thank you Paul,
I'll look into DCD.
By the way, what is PBPL?
-Andrew
It comes with the new PBP 2.50 upgrade.
PBPL is the new .exe file that lets you use 32 bit variables (only on the 18FXXX series).
You can use negative numbers without having to use two's complement; you can use * + / - operators with 32 bit.
DIG and other instrucctions are "enhanced" by it.
Now what I want to do is go backwards from what I did before.
What would be a good equation/function for:
Given a = %00100
b should equal 2
%00001 = 0
%00010 = 1
%00100 = 2
%01000 = 3
%10000 = 4
andrewroz, Use the NCD function. It will give you the value of the most significant bit set.
It's in the manual.....
Dave Purola,
N8NTA
PBPL it's the name of the compiler that uses long format:
PBPL = PIC Basic Pro LONG
Bookmarks