Program too long?


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429

    Default Program too long?

    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:

    Code:
    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:

    Code:
            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.
    Last edited by Kamikaze47; - 19th March 2008 at 10:09.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    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.
    Last edited by Kamikaze47; - 19th March 2008 at 10:09.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  4. #4
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    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.
    Charles Linquist

  5. #5
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Thanks Charles.

    It was this line causing the problem:

    Code:
    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
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    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...

  7. #7
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    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.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    thanks Kamikaze47, cos u actually pointed out a bug in my code there.

    Should have been ...
    Code:
            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>
    DT

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. High Resolution Timer & Speed Calculator
    By WOZZY-2010 in forum Code Examples
    Replies: 4
    Last Post: - 7th February 2010, 16:45
  3. Replies: 1
    Last Post: - 23rd May 2009, 09:22
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 14:30

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts