Shop OBEX P1 Docs P2 Docs Learn Events
SOLVED - pfth_p2 - problems with converting to AUXRAM data stack — Parallax Forums

SOLVED - pfth_p2 - problems with converting to AUXRAM data stack

mindrobotsmindrobots Posts: 6,506
edited 2014-03-06 15:38 in Propeller 2
I've been playing with the P2 version of pfth that Dave Hein created.

The first step was to remove the bit-banged serial I/O and replace it with SERA (SERIN/SEROUT) - that worked great! (It's attached below pfth_serio.spin)

The second step was to convert the return stack to use AUXRAM and PTRY and integrate it into the serio version - that worked great! (It's attached below as pfth_rstack.spin)

The third step was to to convert the data stack to using AUXRAM and PTRX and integrate it into the rstack version - that one didn't work. I decided to back up a step and integrate the data stack version into serio....that didn't work either. I'm doing something wrong (probably something obvious and stupid ) but I'm too close to see it as I've been looking at it on and off for about a week now. I've attached the pfth_dstack.spin version also. The code to set up and use the AUXRAM stak with PTRX seemed pretty straight forward. If I was to guess where I broke it, it's in the indexstack routine or in the pick and roll routines. IN my mind, they work but sadly it doesn't get to execute in my mind! As it is now, it just hangs someplace after loading.

Anybody care to take a look and see what I'm missing?

Thanks!

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2014-03-03 16:18
    Nice work.
    Maybe I can learn forth while I wait for the threading to be resolved ;)
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-03-03 16:32
    Cluso99 wrote: »
    Nice work.
    Maybe I can learn forth while I wait for the threading to be resolved ;)

    It' s all Dave's excellent implementation except for the 15 or so lines scattered throughout that broke it. Those are mine!!

    Dave did a great job that is readable, well documrnted PASM. A great Learning tool for Forth and PASM alike!
  • Dave HeinDave Hein Posts: 6,347
    edited 2014-03-06 14:48
    In the pop1 routine, the "chkptrx wz" statement should be "cmp parm1, #0 wz". The zero flag should indicate if the popped value is zero, and not whether the stack pointer is zero. Everything else looks good.
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-03-06 15:38
    Dave Hein wrote: »
    In the pop1 routine, the "chkptrx wz" statement should be "cmp parm1, #0 wz". The zero flag should indicate if the popped value is zero, and not whether the stack pointer is zero. Everything else looks good.

    Cool! Now I want to run to a computer and test! For some reason, I thought we were checking to see if the stack bottomed out.

    Thanks!

    EDIT: Dang, Dave! That was easy!! It works like a champ now. I don;t know how long I stared at that and didn't see it or let my brain try and tell me what it should be instead of just reading it. Next step combine everything and see how much using P2 features saves in HUBRAM and COG! THANKS!!
Sign In or Register to comment.