Shop OBEX P1 Docs P2 Docs Learn Events
SXSim for MS Windows — Parallax Forums

SXSim for MS Windows

Guenther DaubachGuenther Daubach Posts: 1,321
edited 2010-09-08 20:52 in General Discussion
Hi Folks,

from this post, you can download the latest version of my SX Simulator for MS Windows.

To install it, just un-zip the files into any folder, and run it from there. If you like, you may manually put a shortcut to SXSimW on your desktop.

You will find the documentation in a separate ZIP file, attached to this post.

SXSim is by no means complete yet, and I'll add more features when I have the time.

Have fun!

In order to keep this post at moderate length, I have decided to strip down the software history and comments section to only contain the most recent two entries. From now on, you will find the complete history attached to the end of the documentation. Therefore, whenever I post a new software version, I will also post a new doc file in the future.

Remarks:

Added June 24, 2006:
This new version 2.08.05 comes with the following fixes/enhancements:

- internal program counter is now displayed
- "odd" clock frequencies are now handled correctly
- SKIP handling corrected

Added December 12, 2006:
This new version 2.08.06 comes with the following fixes/enhancements:

- When WREG is mapped into address $01, the contents of RTCC will be shown in a separate field
- In RUN mode, the list display no longer jumps to the first line
- When SXSim is terminated with the main window minimized, it will be re-opened with its default size when invoked again later
- When TRIS bits are changed, the I/O Panel is correctly updated in "Run" mode now
- Breakpoints now work correctly on targets of JMP w instructions
- Wrong cycle count of skip instructions (2 instead of 3 in case of a skip) fixed
- SKIP status display fixed, it will now only be highlighted when a skip instruction actually causes a skip
- New "Run to Right-Clicked", and "Jump to Right-Clicked" modes
- New status display in the Commands window indicating the current mode of SXSim ("Idle", "walking", or "running")

When your version of SXSim was auto-installed together with the latest SX-Key software, make sure to install the new SXSim files into the Tools\SXSim folder located in the main SX-Key folder (usually Program Files\Parallax Inc\SX-Key v3.1\Tools\SXSim).

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

G
«1345678

Comments

  • simonsimon Posts: 20
    edited 2004-10-23 12:56
    Hi!

    Does this Version support the output from Bytecrafts SXC Compiler ?
    Last time i tried it all i got was an error message after reading the
    sxc generated file.

    Bye, Simon
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-10-23 22:44
    Simon,

    SXSim only works on the LST files that are generated by SASM as part of the SX-Key IDE. To be honest, I don't know anything about the SXC Compiler, i.e. I never used it before. Nevertheless, if SXC generates a SRC file that finally can be translated by SASM, you should be able to "feed" the resulting LST file to SXSim.

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


    G
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2004-10-24 01:37
    Gunther,

    When I load a SASM produced .lst file from a program

    that I currently run (so it works) the SXSIM produces:

    Laufzeit fehler 11

    Division durch null



    What happens here?

    regards peter
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-10-24 07:46
    Peter,

    if possible, could you please send me this .lst file via private eMail, so that I can test what happens?

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


    G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-10-24 10:42
    Peter,

    thanks for sending the .LST file. The error was caused because SXSim cannot handle freq directives like

    freq RESONATOR * 1000000, i.e. expressions, but numerics like 50000000, or 50_000_000 only.

    I have changed SXSim in a way that it ignores such expressions. In this case, it does not calculate execution times.

    This new version of SXSim is 1.41, and I have appended a new ZIP file to my original posting with this·version.

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


    Günther
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-10-24 10:47
    simon said...
    Hi!

    Does this Version support the output from Bytecrafts SXC Compiler ?
    Last time i tried it all i got was an error message after reading the
    sxc generated file.

    Bye, Simon
    Simon,

    thanks for sending me the sample files. Unfortunately, the LST files created by the Bytecraft SXC Compiler have a completely different format as the ones generated by SASM (thy only contain C code, no assebmly mnemonics). Therefore, SXSim cannot handle these files at all.

    Maybe, the Compiler has an option to generate Assembly source files which you can then run through SASM to achieve a .lst file that can be handled by SXSim.

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


    G
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2004-10-24 11:26
    Gunther,

    I changed the lines

    resonator equ 20

    freq resontor*1000000

    into

    resonator equ 20

    freq 20_000_000 ;equ resonator*1000000

    and now the .lst file loads.

    thanks.

    regards peter
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-10-25 15:40
    Dear Forum Administrator,

    is it possible to make my first post in this thread "sticky", so that it stays on top?

    I plan to put new versions of SXSim in the forum from time to time, and so they could always be found in the first "sticky" message.

    Thanks!

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


    G
  • Jim BrainJim Brain Posts: 17
    edited 2004-10-26 20:24
    I'm not sure if this is a bug, or just my lack of understanding of the RTCC

    I have a piece of code (the dualuart VP) that does:

    mov w,#RTCC_ON | RTCC_PS_OFF ;setup option register
    mov !option,w

    After that command, the RTCC starts going up in SxSim. However, since I don't want IRQs enables, I changed it to:

    mov w,#RTCC_ON | RTCC_ID | RTCC_PS_OFF ;setup option register
    mov !option,w

    But then the RTCC does not increment is SxSim.

    The EQUs are:

    RTCC_ON =%10000000 ;Enables RTCC at address $01 (RTW hi)
    ;*WREG at address $01 (RTW lo) by default
    RTCC_ID =%01000000 ;Disables RTCC edge interrupt (RTE_IE hi)
    ;*RTCC edge interrupt (RTE_IE lo) enabled by default


    Jim
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-10-27 15:08
    Jim,

    you are right - this was a bug in SXSim. In the meantime, I have fixed it.

    You can find the new version in the "sticky" post at the top of this thread.

    From now on, I will place two separate ZIP archives there. One containing just the latest version of SXSim, called SXSimvvv.zip (where "vvv" is the version), and another one called SXSimdoc.zip containing the documentation, and a sample .lst file. This makes downloading faster, in case just the software has been updated.

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


    G
  • TrapperBobTrapperBob Posts: 139
    edited 2004-11-05 00:32
    Hi Guenther,

    Is the 142 version meant to work on XP?

    I am getting a message:

    Component Comdlg32.ocx or one of its dependencies not correctly registered: a file is missing or valid

    This Xp install is fresh and working fine otherwise

    Thanks
    Trapper
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-11-14 11:41
    Hi Trapper,

    sorry for answering so late - I simply overlooked your posting.

    Please check if you have cmodlg32.ocx on your machine. If this is the case, try registering the control using regsvr32,

    ie. from the DOS prompt type:

    regsvr32 comdlg32.ocx

    be sure to use proper pathnames.

    Should comdlg32.ocx not be available on your machine, you may Google the net for a download location, or contact me off-list.

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


    G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-11-14 18:35
    Hi Folks,

    I have uploaded a new version of SXSim (1.43) - you'll find it in the topmost post of this thread. In this version I fixed a bug which under certain situations caused shifting in and out the carry flag incorrectly with RR and RL instructions (and maybe, other bit-related operations either).

    Two bugs met in a program. Says the first one: "My programmer is searching for me since two weeks." Says the other one: "Ha, my programmer does not even know that I exist."

    I'm pretty sure that there are some of these still living in SXSim, so your bug reports are always welcome.

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


    G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-12-07 09:09
    Hi Folks,

    I have uploaded a new version of SXSim (1.44) - you'll find it in the topmost post of this thread. In this version I fixed a bug that caused IREAD to return wrong values in the M register.

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


    G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-12-08 18:15
    One day later...

    Another version of SxSim (1.45).

    Thanks to Jonathan, the current SxSim "Power Tester", I could fix another SxSim bug. This was a tricky one because in former versions, I made SxSim behave like I liked the SX to behave.

    Here is an example:

    org $100
    page table
    mov W, #1
    jmp PC+W
    jmp state_1
    jmp state_2

    org $200
    table = $
    state_1
    ;
    ; some code
    ;
    state_2

    It would be nice to have the initial "page table" instruction prepare the page bits for the jump table instructions following the "jmp PC+W" instruction i.e. have the "jmp PC+W" ignore the page bits (like SxSim did).

    In "real SX silicon", this is not the case, i.e. the "jmp PC+W" respects the page bits, so that the next instruction following the "jmp PC+W" is executed at address $201 but not the "jmp State_2" at address $104 as one might expect/hope/wish.

    SxSim now handles this like the "real" SX does (with the advantage that you get a warning message in case the jump should end in "nirvana").

    I also received some bug reports that SxSim did generate a type mismatch run-time error at start-up. This is caused by the different date-time formats depending on the country settings of Windows. Should you run into this problem, simply delete any *.SIM files in the folders where you have the *.LST files for simulation. The next time, SxSim saves *.SIM files, they will contain the time-date information of the assiciated *.LST file in the format that matches your Windows country settings.

    Thanks to all of you helping to improve SxSim!

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


    G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-12-11 14:07
    Viola,

    here is a new version of SxSim (1.50) that suppprts most of the "secret" SX instructions.
    Have fun!

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


    G
  • pjvpjv Posts: 1,903
    edited 2004-12-11 20:43
    Hello Guenther;

    Wow, that was fast. You must have been up all night!

    Peter
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-12-11 22:19
    Hello Peter,

    although I'm used to be up at nights, this time, I did it Saturday morning. Thanks to your clear description, I knew what had to be done. I hope the simulation reflects how the "real" SX performs on these "secret" instructions.

    When I have the time, I'll test-run them on a "real" SX, and compare the results to what SxSim does.

    A set of simple macros to have mnemonics instead of DW directives for such secret instructions would be fine. Maybe, our "MOM", i.e. Master Of Macros, James Newton has some in the drawer smile.gif

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


    G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-12-13 18:55
    Hello "SxSim-ers",

    Version 1.51 is here, together with an updated manual (see the first thread message).

    This one allows you to disable the "RETI/RETIW without interrupt checking" (might be handy when using RETI/RETIWs together with the recently published "secret or hidden" SX features). I have also changed the format of the *.SIM files that are created after each SxSim session. Future versions can now be "downward-compatible", i.e. they will be able to restore parameters (like breakpoints, etc.) saved by earlier versions (>= 1.51).

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


    G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-12-21 20:07
    Hello "SxSim-ers",

    I have posted a new version 1.52 of SxSim in the very first thread message. Not a big change, I just fixed the handling of the shadow stacks that are used by the "secret" PUSH/POP instructions to comply to the "real" SX silicon.

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


    G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2004-12-22 21:48
    Hello "SxSim-ers",

    I could not resist adding another feature to SxSim: The "Undo Single Steps". When single-stepping, it may happen that you step "too fast" sometimes, i.e. click the "Step" button just before noticing important changes of file register contents, etc.

    Version 1.53 of SxSim now keeps track of the last 20 single steps, and the new "Bck" button allows you to "roll them back".

    Have fun!

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

    G
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-01-02 14:12
    Gunther,

    I use version 1.53 and have a problem with break points.

    Using my latest test.src file (post smallc compiler) it appears

    a set breakpoint s ignored. I set a breakpoint at label :zero_end

    (just after clearing memory) but walk and run modes simply continue.

    Can you confirm this?

    Also, hitting the reset button, does that clear breakpoints or are these

    only to be cleared by hitting CLR BP ?

    Also, when using find label, when the label is found, the sxsim window is

    repositioned on the screen. I use 800x800 resolution and the window

    is normally positioned with the titlebar at the top. After a find label

    the window moves down to about 25% from the top of the screen.

    ·This also happens when I display the I/O panel and then hide

    the I/O panel.

    regards peter




    Post Edited (Peter Verkaik) : 1/2/2005 2:21:39 PM GMT
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-01-03 10:25
    Peter,

    thank you for your report - I'll try to fix these problems in the next version to be released soon.

    Yes, you are right, the reset button only "resets" the simulated SX but it should not reset the breakpoints. The CLR BP button should do that.

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

    G
  • David BDavid B Posts: 591
    edited 2005-01-03 18:44
    Hello Gunther,

    I just started using SXSim - it is great! It is amazing how it opens up the entire workings of the process right in front of my eyes! I've already used it to tune up a few badly-coded routines.

    I've used it on Windows NT 4.00, where it works fine. My Windows 95 laptop was lacking the file comdlg32.ocx but I copied the WinNT file and it worked.

    Minor suggestion - I'm getting lazy about initializing RAM because the SxSim zeroes RAM for me, unlike the actual chip, according to documentation.

    What about having SxSim explicitly write random values into the simulated RAM locations and those registers that power-up to "undefined" in the real chip?

    This would force code to initialize where it ought to, and might help detect initialization bugs for when code goes live. Maybe a checkbox could turn on this feature for final testing of a design.

    David
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-01-05 19:26
    Hello "SxSim-ers",

    Recently, I have posted a new version 1.54 with some bug fixes and some new features.

    Peter V.:

    I hope the breakpoint and window position problems are fixed now.

    James N.:

    I did not touch the way, SxSim handles page crossings on "straight code", i.e. it should behave like specified in the SX datasheet.

    David B.:

    Sorry, I forgot to include your suggestion concerning random RAM initialization, IOW, SxSim still nicely clears all RAM at startup. I'm not sure if you have the latest edition of my SX book where I describe an include file that takes care of clearing the RAM. If not, please visit the Parallax WEB site for a free download of all book example files. When you include the "Clr2x.inc" file right after the main program enty, you will always have a "clean start".

    One final word:

    Please have a look at

    http://forums.parallax.com/forums/default.aspx?f=3&m=58766

    concerning the Parallax donation plan for the tsunami relief fund. I think the poor people in South Asia really deserve it after this tremendous natural desaster.

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

    G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-01-09 00:37
    Hi "SxSim'ers",

    believe it, or not - today, I used SxSim to test one of my own SX projects smile.gif .

    This project contains quite long delay loops handled by the ISR. This means that testing this code with SxSim would take hours, even in Run-mode, as the simulated Run is still a lot slower than running the "real SX silicon".

    Therefore, I'm thinking of an SxSim option that allows to turn registers into "hyper counters", e.g. by right-clicking any of the fields in the register display array.

    A "hyper counter" would immediately accumulate a value of zero on an inc, dec, incsz, decsz instruction, and the mov w, fr++, or mov w, fr-- would behave similarly.

    Do you think this might be a meaningful new feature of SxSim? Please note that the SxSim cycle counter can no longer be accurate, when "hyper counters" are avtivated because SxSim can't track the execution cycles any more.

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

    G
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-01-12 07:13
    Gunther,

    I encountered a stack problem with the attached file.

    At some point the stack shows 7 words used with 0269h being the oldest

    word. An executed retp does not move the stack down, instead this

    0269h gets copied from position 7 to position 6. As a consequence

    following calls will overflow the stack.

    I set the breakpoint to 1267 and then walk, observing the stack.

    From the breakpoint on singlestep and observe the stack.

    Things go wrong while inside an ISR cycle. Not sure if that is the

    problem. Uncheck RETI.

    regards peter




    Post Edited (Peter Verkaik) : 1/12/2005 7:32:23 AM GMT
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-01-12 18:41
    Peter,

    I'll d/l your sample list file, and take care of fixing the problem - please stay tuned...

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

    G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-01-12 22:23
    Peter,

    thanks for your sample code - it helped me a lot to find and fix another bug in SxSim which had to do with bad return stack restauration together with RETP instructions.

    I'll upload a new version (1.55) in a minute.

    Besides the bug fixes, I have also added the "Hyper Counter" mode for file registers in this version. To learn more about this feature, please download the new docs that I'll also post next.

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

    G
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-01-12 22:35
    Hi "SxSim-ers",

    thanks to Peter's report, I could fix another SxSim bug. Therefore, I have just posted the new 1.55 version (see the first message in this thread). I have also added a new "Hyper Counter" feature. You will find more information about it in the new recently posted docs.

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

    G
Sign In or Register to comment.