PDA

View Full Version : Program too long?



Kamikaze47
- 19th March 2008, 04:41
Im working on a fairly large program, and ive been working on a number of subroutines in separate files which are to be included in the main program.

Each file will compile fine on its own, but when I include all of the subroutines or copy/paste them all into one .pbp file (about 2300 lines long), I get the following errors on compile:


Warning[207] main.asm 1525 : Found label after column 1. (warning)
Error[108] main.asm 1525 : Illegal character (")

When I look at main.asm line 1525 i see this line:


ifdef T8
ifndef NO_T7_WARNING
this line >>> warning "Temp variables exceeding T7"
endif
endif

It looks something to do with interrupt context saving? I'm using DT's instant interrupts.

Could my program be too long somehow? I'm not running out of codespace on the PIC so i cant see why that would be the case.

Can anyone help?

*edit* If i remove the interrupts from my code it compiles fine, so its def something to do with interrupts.

mackrackit
- 19th March 2008, 09:47
This may help.
http://www.picbasic.co.uk/forum/showpost.php?p=40026&postcount=3

Kamikaze47
- 19th March 2008, 09:58
Cant see the connection between that and the problem i'm having.

*edit* If i remove the interrupts from my code it compiles fine, so its def something to do with interrupts.

Charles Linquis
- 19th March 2008, 12:31
I believe the problem is that your program is creating too many temporary variables. The program isn't too long, but you will have to simplify some of your lines. Break up some of the longer statements into two or more smaller ones.

Kamikaze47
- 19th March 2008, 13:12
Thanks Charles.

It was this line causing the problem:


IF (temp>=$32 AND temp<=$47) OR (temp>=$3A AND temp<=$40) OR (temp>=$5B AND temp<=$60) OR (temp>=$7B AND temp<=$7E) OR (t2b_word_length+index=t2b_focus_length) THEN

I'll expand it out into a number of IF statements and that'll fix it.

Cheers

skimask
- 19th March 2008, 13:19
IF (temp>=$32 AND temp<=$47) OR (temp>=$3A AND temp<=$40) OR (temp>=$5B AND temp<=$60) OR (temp>=$7B AND temp<=$7E) OR (t2b_word_length+index=t2b_focus_length) THEN

IF (temp>=$32 AND temp<=$47) OR (temp>=$5B AND temp<=$60) OR (temp>=$7B AND temp<=$7E) OR (t2b_word_length+index=t2b_focus_length) THEN[/QUOTE]

You can get rid of one of the temp-AND cases in the >$32 and <$47...first couple of ANDs
Might save just that one AND/OR temp variable right there...

Kamikaze47
- 19th March 2008, 13:29
thanks skimask, cos u actually pointed out a bug in my code there. the first set should have been $20 to $2F... i accidentally put the decimal numbers in instead of hex.

Darrel Taylor
- 19th March 2008, 22:51
thanks Kamikaze47, cos u actually pointed out a bug in my code there. :eek:

Should have been ...
ifdef T8
ifndef NO_T7_WARNING
messg "Temp variables exceeding T7"
endif
endif

Then it would display a relevant "Warning", instead of obscure errors.
<br>