Good day to all.

I am a relative PICbasic Pro newbie but have several years of writing PIC assembler code.

I am taking some older PICbasic Pro code written by a co-worker and making some simple changes. Some of those changes require moving to a larger PIC.

The current PIC has 128 bytes of eeprom. The PIC I'm moving to has 256 bytes of eeprom.

User data in the eeprom is stored beginning at address 0. System data is stored in the eeprom starting at the top and growing downward.

I'm trying to use symbolic names for the upper eeprom addresses but failing miserably. I'm hoping that someone can point me in the right direction.

Here's what I've tried so far:

'eeprom aliases
ee_max con 255 'highest eeprom address
ee_patnum con (ee_max) 'eeprom addr for number of current pattern
ee_stepnum con (ee_max-1) 'eeprom addr for current step number in pattern
ee_bright con (ee_max-2) 'ee addr for stored brightness
ee_xfade con (ee_max-3)
ee_maxpot con (ee_max-4) ' ee addr for max pot (not currently used)

eeprom ee_patnum, [2] 'current pattern
eeprom ee_stepnum, [0] 'which step within pattern we are on
eeprom ee_bright, [255] 'brightness
eeprom ee_xfade, [254] 'crossfade point

The first chunk of instructions is intended to allow easy changing of eeprom size. The idea is that I simply specify the highest eeprom address and the remaining addresses are calculated automatically.

But: it doesn't work. I get a Syntax error.

I can do this in assembler easily. I'm hoping there is a similarly easy method of doing this in PICbasic Pro.

Many thanks!

dwayne