Shop OBEX P1 Docs P2 Docs Learn Events
FlexGui -- S9 duplicate definition — Parallax Forums

FlexGui -- S9 duplicate definition

I have a legacy P1 spin program that works well. I tried to compile it with flexgui using P1 defaults. It generates a .pasm file also gives the following 'error: Redefining symbol sp'. I assume is stack pointer. Anyway. In looking through the generated PASM file I find on one label 'sp'. There are many mov and sub and add commands using 'sp', but only one line with the label 'sp'.


Any suggestions.

Comments

  • Cluso99Cluso99 Posts: 18,069
    Since you posted in the P2 discussion, are you trying to convert your program to P2, or just trying flexgui out for P1?
  • Find and replace all instances of sp with another name, even something simple like spp. Let us know if that allows it to compile.
  • I haven't heard of that problem before. Could you post your program? It's hard to diagnose without seeing the code.
  • User Problem. Code doesn't compile but for other reasons. Now gets the message
    "error: fit 496 failed: pc is" but I think that is because the code to generated code is to large (original P1 SPIN code is rather large) or one of the cog codes is won't fit into a cog. I'll have to experiment to find out which.

    This is my first attempt to use FASTSPIN and FLEXGUI so not surprised to have problems.

    Thanks for the replies. I'll keep you posted.
  • Cluso99Cluso99 Posts: 18,069
    edited 2020-05-06 20:07
    Yes, your code is too big to fit in cog. You can look at the listing if one was output.
    If not use the fit $1ef command in your code to find out where it overflows, or break it into LUT with a jmp then org $200 and put some code in LUT. Variable registers cannot be in LUT although tables go there nicely.
  • Cluso99 wrote: »
    break it into LUT with a jmp then org $200 and put some code in LUT.

    Is there a trick to automatically load the LUT RAM with COGINIT or do we have to load it manually with WRLUT?

  • ManAtWork wrote: »
    Cluso99 wrote: »
    break it into LUT with a jmp then org $200 and put some code in LUT.

    Is there a trick to automatically load the LUT RAM with COGINIT or do we have to load it manually with WRLUT?

    There's no way to load LUT RAM with COGINIT. You can use WRLUT, or better you can do a SETQ2+RDLONG, which will let you read N longs directly into LUT.

    And just to clarify: LUT is a P2 only feature. I'm not sure if the original poster is using P1 or P2.
  • Thankx, good to know, learned something new, again. For the case I run out of cog RAM...
Sign In or Register to comment.