I see an error on your PBP program

Code:
define OSC 48temp VAR word
should be

Code:
DEFINE OSC 48
temp VAR word
though I had no time to check all of your code.

Ioannis