Compilation error Block overflow for ENDASM


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563

    Unhappy Compilation error Block overflow for ENDASM

    Hi,

    I wrote a lengthy asm ISR in my prog and stumbled at this error Block overflow for ENDASM. Is it a PBP limitation, crossing boundary or else. Please help.
    Regards

    Sougata

  2. #2
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Default

    OK,
    it's a PBP limitation. Just insert an endasm and asm in the middle of the block and it works...
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  3. #3
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Thanks a lot

    Hi,

    Thank you for the prompt reply. I will try it now keeping my fingers crossed as it is my ISR. Just a thought. While inside the ISR we are using asm. What if I start the ISR in asm. Put an endasm before a retfie.Put some PBP code and then start an asm and fire the retfie from there after restoring context. Any thoughts or insite.
    Last edited by sougata; - 22nd March 2006 at 07:59.
    Regards

    Sougata

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


    Did you find this post helpful? Yes | No

    Default

    sougata,

    The compiler will allow you to do that. And in some cases, you can get away with it, as in the Elapsed Timer Demo that uses several PBP statements in an ASM interrupt.

    The problem arises when you run a PBP statement that uses any of PBP's system variables such as R0-R8, RM1 RM2, etc.   Anytime you overwrite any of those variables in an interrupt routine, the code that got interrupted will get completely lost because the variables aren't what they are supposed to be anymore.

    In general, any non-arrayed variable assignments are safe.

    Abit = Bbit
    Abyte = Bbyte
    Aword = Bword

    and "Simple" IF structures. "Simple" means no AND's, no OR's, and no formula's in the expression.

    IF Abyte = Bbyte THEN
       Aword = Bword
    ENDIF

    Anything like that will be OK. But a PAUSE or a SEROUT or 90% of everthing else will not work.
    <br>
    DT

  5. #5
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Thanks Darrel for the info

    Hi,

    Thanks Darrel. I understand that. I need to study how PBP works internally. (Don't know when I will get time to do that.) My need for the ISR was the speed so I will not anyway like to use PBP inside the ISR. However while developing and testing program flow it comes handy to do a little "IF-THENs" then port them to asm. BTW I could not find out if PBP uses the additional instructions that PIC18 supports. Like the compare and multiply instructions. I am finding that most of times I have to use asm blocks to optimize speed.
    Regards

    Sougata

  6. #6
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Talking

    Hi,

    Inside an ISR I will only use assembler (each part in an own asm-endasm-block),
    but outside ... PBP is tough enough to strike assembler, when you choose the right commands and optimize your code ! ;-)
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  7. #7
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default I agree

    Hi,

    Being a self-taught (as we are all!) coding in assembly is a great adventure(insane sometimes for me). But as Steve says "Learning Opportunities". I stumble into problems and asm is the only way to get through. Imagine life with only asm and no PBP!!! Thanks BigWumpus again I solved my problem with your suggestion.
    Regards

    Sougata

Similar Threads

  1. Overflow bit?
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 14th October 2006, 01:03
  2. Interrupt stack overflow problem with Resume {label}
    By Yuantu Huang in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 3rd May 2005, 01:17

Members who have read this thread : 1

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