Guessing not required.
You can measure it.
instruction execution time
http://www.picbasic.co.uk/forum/show...72&postcount=2
Guessing not required.
You can measure it.
instruction execution time
http://www.picbasic.co.uk/forum/show...72&postcount=2
DT
Oh, forgot to mention ...
Changing
IF PortC.4=1 THEN
-- to --
IF PortC.4 THEN
will reduce it considerably.
With IF PortC.4=1, it places the value of the BIT in a temporary WORD sized variable, then calls a PBP library function that compares the whole word.
With IF PortC.4, it's 2 instructions (btfss/goto).
This only works with BIT vars.
<br>
DT
Thanks Darrel, that’s great. What is the effect of the underbar preceding picOSC in line one? I looked through the PBP manual but didn't see anything about an underbar. Did I miss it? I'll save your post link for future reference. Thanks again!
Mountain
In assembly, there are a lot of names already used, many of them are even single letters. Since you can't reuse variable names that are already in use, PBP places an underscore in front of all variables declared in your program to eliminate possible contentions.
While working in PBP those underscores are transparent, because PBP adds them when needed. But at the ASM level, you have to add the underscore to the PBP variable name to be able to access it.
In the case of _PicOSC, it just retrieves the value of the DEFINE OSC XX for use in calculating the amount of time used by the statements.
The OSC value is not directly available in PBP.
Section 8.2 Programming in Assembly LanguageDid I miss it?
Page 180 in the latest manual.
hth,
DT
Bookmarks