Shop OBEX P1 Docs P2 Docs Learn Events
SC Clock Cycles in Sim — Parallax Forums

SC Clock Cycles in Sim

LewisLewis Posts: 23
edited 2006-12-10 21:58 in General Discussion
Hello All,

I'm not sure if this was addressed before but it seems that the SXSim seems to think the SC instruction is 3 cycles when it skips. Is this correct? In the documentation, I see it as 1 cycle no skip and 2 cycles when skipping.

Thanks,

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Lewis [noparse][[/noparse]m80] -

Comments

  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2006-12-09 08:34
    Lewis,

    you are right - you found a bug in SXSim. The SC, as well as other skip instructions increment clock cycles by 3 in case of a skip instead of 2 as they should. The reason for this is that I have added an increment for the clock cycles in the skip handling routines, and later decided to handle this in the routine that takes care of incrementing PC. So I forgot to remove the code from the skip handlers. Sorry for this inconvenience - it will be fixed in the next version.

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

    G
  • LewisLewis Posts: 23
    edited 2006-12-09 20:15
    G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2006-12-10 09:58
    Lewis,

    yes, it was a simple fix, and I learned the same lesson once again: When making changes to working code, double-check how this might influence other parts of the code.

    When SXSim loads a program for "debugging", it actually reads and parses the LST file, and loads all the lines up to the beginning of the cross reference section into a Windows list box. Depending on the speed of the PC you are using, the available free RAM, and the size of the list file, this may take a while. Nevertheless, I never experienced load times longer than - say - a few seconds. If you could send me a LST file that takes forever to load, I would try to verify it here. Maybe, there is another bug in SXSim causing the delay - you never know...

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

    G
  • LewisLewis Posts: 23
    edited 2006-12-10 19:46
    G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2006-12-10 21:58
    Lewis,

    ok - I got you smile.gif . Downloading code into an SX depends on the code size. I also noticed here, that sometimes downloading takes longer as usual. Seems as if some Windows processes running in the background can pretty much slow down the SX-Key IDE. I have never tried it but maybe it is an idea to give the IDE a higher priority in TaskManager when programming speed really counts.

    BTW: I'll post a new version of SXSim in the next coouple of days with your reported bugs fixed (plus some other fixes and improvements). Sorry - no SX 48 multi purpose timers/counters simulation for now.

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

    G
Sign In or Register to comment.