Shop OBEX P1 Docs P2 Docs Learn Events
pPropellerSimulator problem with NEGC? — Parallax Forums

pPropellerSimulator problem with NEGC?

ManAtWorkManAtWork Posts: 2,178
edited 2009-10-14 13:10 in Propeller 1
Hello,

I was·just playing a little bit with pPropeller Simulator as I didn't manage to get GEAR running. I found a problem that could be a bug or maybe it's just my ignorance... The simulator seems to mix up NEGC and NEGNC.

     mov   x,#$F0
     shr   x,#1 wc  ' clear carry
     negc  x,x      ' should be nop
     mov   y,#$F1
     shr   y,#1 wc  ' set carry
     negc  y,y      ' should negate y


·I thought this should give the results x=$78 and y=$FF88. But in the simulator it's the other way round. confused.gif The propeller manual says, "NEGC [font=Times New Roman,Times New Roman][font=Times New Roman,Times New Roman]stores [/font][/font][font=Times New Roman,Times New Roman][font=Times New Roman,Times New Roman]Value [/font][/font][font=Times New Roman,Times New Roman][font=Times New Roman,Times New Roman](if C = 0) or [/font][/font][font=Times New Roman,Times New Roman][font=Times New Roman,Times New Roman]–Value [/font][/font][font=Times New Roman,Times New Roman][font=Times New Roman,Times New Roman](if C = 1) into [/font][/font][font=Times New Roman,Times New Roman][font=Times New Roman,Times New Roman]RValue ". So I think the simulator is wrong, isn't it. On the other hand, NEGZ and NEGNZ seem to work as expected.[/font][/font]

I also found out that a lot of commands and the math function tables are not implemented in pPropellerSimulator. Is there a newer version (I have 0.9.9)?

Thanks for any help

Comments

  • AleAle Posts: 2,363
    edited 2009-10-13 09:27
    Hallo,

    I will upload a newer version to the sourceforge page. I'd recommend you download that one. Be aware that some changes to the functionality have been made. To get it working as the version you used tick the "Compile to COG" checkbox in the editor. The code is going to be loaded to the COG and to the HUB. A copy of the ROM is also there, so all math tables should be accessible using RDxxx.

    Play with this version. The HUB disassembler is not yet implemented :-(

    Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU
    927 x 820 - 178K
  • ManAtWorkManAtWork Posts: 2,178
    edited 2009-10-13 10:05
    Hello Ale,

    wow, I didn't expect such a quick answer. So you are the author of pPropellerSimulator? Congratulations, very nice program. Although not really finished yet, it's nice to have and saves a lot of time finding errors in assembler code. I wonder why Parallax doesn't offer a real debugging tool. BTW, as I'm working on a commercial project (seems to be an exception in the propeller world) time is money and I had no problems paying for a good tool.

    I'll check the new version, thank you very much
  • Karl SmithKarl Smith Posts: 50
    edited 2009-10-14 01:35
    I can't get this version to work I'v tried
    ··· java AbsoluteLayout.jar and·java swing-layout-1.0.jar and I get the following error
    ··· Exception in thread "main" java.lang.NoClassDefFoundError:

    The last version 9.9 had a pPropellerSim.jar for starting the program, maybe this is just missing from the zip file
  • AleAle Posts: 2,363
    edited 2009-10-14 08:49
    Karl, you have to drop this jar where the other one was, so the lib directory (the one containig that class) can be found smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU
  • ManAtWorkManAtWork Posts: 2,178
    edited 2009-10-14 12:42
    Hello Ale,

    I managed to install the new version, at least I get no error message. But it behaves totally different than the old version. The layout seems to be a little confused (icon bar overlaps the hub/cog folders) but that doesn't matter much. But when I load a binary saved with the propeller tool I see some code I've never·seen before (the spin interpreter?) in COG 0. When I run it, it does only nonsense and doesn't load my assembler code. If I manually insert my assembler source in the editor window and compile it it still doesn't work at all. The·code is partially visible but crippled somehow (for example "add },ang" instead of "add··step,ang"). All data labels (the longs behind the instructions) are mapped to wrong adresses (multiplied by 4 or something?). And yes, I checked the "compile to cog" flag.

    Can I contact you off-list?

    Thanks
  • AleAle Posts: 2,363
    edited 2009-10-14 13:10
    yes do it.

    As you can see, write once run everywhere is just a lie. YOu saw the Mac OSX screenshot, I haven'T run it in Linux in some time... It look ugly :-(

    Oviously you forgot to read the documentation too... (Where it speakss about the sections directives), try a PM smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU

    Post Edited (Ale) : 10/14/2009 1:15:56 PM GMT
Sign In or Register to comment.