Hi all,

I learnt how to program PICs using Microchips C18. Its only since starting a new job that I have begun learning PBP as its what everyone else uses. The good news is that I like it and am perfectly happy using it.

The only thing I miss is functions. Subs are OK but not being able to pass arguments to them is a little annoying and makes the code a little untidy IMO. So I did some searching in the forums to see if its possible to make custom functions in PBP.

From what I can see there is no way to create custom functions that operate exactly the same as LCDOUT or SHIFTOUT etc. Is this true, or is there some way this can be done?

The only thing I did find is a post by Darrell Taylor about calling PBP from an assembler macro (this can be seen in his LCDBargraphs project) and I got this working quite nicely. However I found one thing that I could not work out. The following works fine and 97 is passed to the macro correctly (which writes it to an LCD ("a")):

Code:
temp = 97
@    MyFunction     _temp
However the following does not work and nothing is written to the LCD:

Code:
@    MyFunction    97
Can anyone tell me why this is? I cannot see why there is a difference.