PDA

View Full Version : Macro file



Mark Esper
- 27th February 2006, 22:24
I get Error: Macro SUB?TCL not found in macro file.
There is no indication of where or what the error is.

Darrel Taylor
- 28th February 2006, 03:00
Hi Mark,

The first thing to do is open up the .LST file with the same name as your program, with Notepad or equiv. Do a search for the error number that's given by the compiler. It should look something like [???], where ??? is a 3 digit number.

That should give a close idea of where the problem is, but not always.

Typically, a macro error means that you are trying to do something that is not supported, or using variables that don't work with that command.

In the case of SUB?TCL, it means that you are trying to subtract a CONstant from a BIT and place the result in a LABEL, which obviously can't happen.

So, somewhere in your program, look for a subtraction that has a LABEL before the equal sign.

Labels are what you would GOSUB or GOTO to.

HTH,
   Darrel

Mark Esper
- 1st March 2006, 15:24
Thank you, mr. Taylor for your advice. It inspires me to study parts of the Melabs program that I was not previously aware of.
The problem turned out to be a typo in writing an IF THEN operation where I had put - where a = was needed. I will be more carefull in the future.
Mark Esper

Darrel Taylor
- 1st March 2006, 20:53
Oh good, you found it. After my post I realized that PBP would have caught the Label before the = sign thing. But I couldn't see any other way to get a SUB?TCL

If statement with - instead of =, that makes sense.   Good find!

And, if you really like studying how PBP works, then these 3 files will keep you on the edge of your seat for months.

.ASM file with the same name as your program.

PBPPIC14.LIB in the PBP folder.

PBPPIC14.MAC in the PBP folder.    (The SUB?xxx macro's are in the .MAC file.)
<br>