Shop OBEX P1 Docs P2 Docs Learn Events
SX Sim For Simulating Multi-Platform (SX28, SX48) Development — Parallax Forums

SX Sim For Simulating Multi-Platform (SX28, SX48) Development

Bashar SadigBashar Sadig Posts: 10
edited 2007-09-25 23:32 in General Discussion
Question Has Several Parts:
·
1) Using Macros and Simulating
2) Using Macros For Conditional SX-Key Directives(Mode Macros, Memory Banks Macros)
·
·
I have been using the SXSim for several years now and was very successful in buildng large projects while in flight or simply anywhere. Impressed I have been, I find SXSim to be more rapid and faster than the debugger itself.
·
When I initiate· a project using the given templates (SX28-SX48) multi-chip interop. development templates.·I start the simulator and hit the run to sweep all and just get the program to loop and interrupt.
·
I get the following error:· "Bad Jump Address or Wrong Page"
·
My questions:
a) Relating to use of Macros, has anyone successfully used the template and the SXSim to simulate SX48?
b) Is there any known issue having to use directive macros (those declared at the header)?
c) The templates I am referring to are UART templates and multi-threading templates. Please let me know as this is the relevant context of this message.

Note: I am suspecting that there may be issues relating to _bank, _mode, etc macros while in simulation.

Regards,

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Bashar Sadig

Senior Solutions Architect - Enterprise Applications

Comments

  • Bashar SadigBashar Sadig Posts: 10
    edited 2007-09-24 15:28
    Attached is a template file to give you an idea about the macros I mentioned.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-09-24 17:06
    SxSim has no knowledge of the SASM macros, and it doesn't need to,
    because SxSim uses the list file.·This list file is created by the
    SASM assembler and has all macros expanded. Unexpanded macros
    are just comment in the list file.
    If SxSim generates the error you mentioned, the page bits PAx
    do not match a target address. You need to go through the list
    file to see where a 'RET' is used where a 'RETP' should have been
    used, or·look for a missing 'PAGE' instruction before a jump or call.

    regards peter
    ····

    Post Edited (Peter Verkaik) : 9/24/2007 5:12:16 PM GMT
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2007-09-24 17:30
    Bashar,

    Peter's explanations are absolutely correct - SXSim does not care about macros, it only reads the code parts and the symbol table from the list file generated by SASM.

    I have implemented SX48 support in SXSim a while ago without excessive testing before releasing it. Now that Parallax sells the SX48 ProtoBoards at such a bargain price, more users write code for the SX48 (and test it with SXSim) than ever before. So chances are much higher that possible bugs in the SX48 simulation become obvious now. So, if you detect any unregularities with SXSim while simulating SX48 code, please don't hesitate to report them (a post in the "sticky" SXSim forum section would be best). This helps me a lot to improve SXSim.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • Bashar SadigBashar Sadig Posts: 10
    edited 2007-09-25 23:32
    Thanks to all, I will use this approach to trouble-shoot the code. Tracing the page directives and "ret" instances as I never actually use them in my coding practice and do heavily use jump tables with retp. Very likely since this has been supplied as source template(s), they may have issues. So, I will strip them down and try to smoke the code. If I found a trace for ret or bad page instruction, I will report it for future reference.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Bashar Sadig

    Senior Solutions Architect - Enterprise Applications
Sign In or Register to comment.