Shop OBEX P1 Docs P2 Docs Learn Events
fifo for isr — Parallax Forums

fifo for isr

Peter VerkaikPeter Verkaik Posts: 3,956
edited 2005-08-05 20:33 in General Discussion
Is there any specific reason why SX/B does not use the secret fifo
to temporarily save M and the 4 parameter bytes?
The attached source shows it saves 9 isr cycles and no need for parameterbyte copies.

regards peter

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-08-05 11:46
    Or make it optional?

    regards peter
  • BeanBean Posts: 8,129
    edited 2005-08-05 13:52
    Peter,
    You can use "INTERRUPT NOPRESERVE", then add the code yourself.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "One experiment is worth a thousand theories"
    ·
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-08-05 14:13
    Where would I place that in the SX/B template file?

    Are there more options like that, and are these documented?

    regards peter
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-08-05 15:01
    Peter,

    There are options like that for INTERRUPT,· PROGRAM (see Directives), and BANK (see Directives).· If we need to clarify the documentation further, please let us know.

    And, as everyone in this forum knows, I love SX/B because it lets me transfer a lot of my PBASIC skills to the SX.· What I mean to say is that I'm not as clever at ASM as most of you are.· That said, I took your FIFO code and incorporated it into an SX/B file.· The compiler (v1.40)·doesn't complain -- would you check to see if this works as you intended?· If it does, you could save this file (or derivative thereof) as your default template and start with it each time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax

    Post Edited (Jon Williams (Parallax)) : 8/5/2005 3:12:55 PM GMT
  • BeanBean Posts: 8,129
    edited 2005-08-05 15:12
    Just a note, if you intend to use that code for the SX48/52 FSR needs to be set to $10 not cleared.

    This always gets me into trouble when using asm in SX/B and moving from the SX28 to the SX48/52.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    Product web site: www.sxvm.com

    "One experiment is worth a thousand theories"
    ·
  • pjvpjv Posts: 1,903
    edited 2005-08-05 16:54
    Hey Guys;

    CAUTION HERE!!!!!

    If you use the "secret FIFO" you WILL get screwed up if you alse expect to use the SX Key to DEBUG code in those places where you use that FIFO.

    Once your code is properly running and the SX Key is no longer used, all seems to operate OK.

    Where the problem comes in, is when your program breaks into the debugger, several of your global variables are stored in that FIFO, so if you mess with those contents then improper values may be restored yielding unpredictable results.

    I have NOT tested this exhaustively, and my description is what my current understanding is; it could be flawed.

    SO PLEASE, USER BE WARE

    That said, have fun pushing the limits!

    Peter (pjv)
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-08-05 17:22
    I think PeterM may be the only one to know the answer to this, but is there an environment variable availible in SASM that specifies whether the code once compiled will be in debug mode vs non-debug mode? It would be really nice to throw a compile error if the code will be run in debug mode when there are secret instructions used that would interfere with debugging.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • PJMontyPJMonty Posts: 983
    edited 2005-08-05 19:03
    Paul,

    Sorry, but SASM doesn't have any such ability. SASM was written by Ubicom for public release as their reference assembler for the SX chips. I believe that due to it being a program "for public consumption", they probably had no intention of adding support, documented or not, for the hidden instructions. I have spent far more time than I ever imagined working on the SASM code and I can guarantee that functionality like that is not buried anywhere in the source files.
      Thanks, PeterM
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-08-05 19:05
    Thanks Peter, it was just a thought, of course one could throw a warning instead of an error, but it would have been nice to completely prevent such an occurance.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-08-05 20:33
    Jon,

    I adapted your template to make the fifo use optional.

    Bean,

    I removed the clr fsr instruction, SX/B already sets it correct and the fifo code does not

    touch the fsr.



    regards peter
Sign In or Register to comment.