Shop OBEX P1 Docs P2 Docs Learn Events
PASM Beginner question regarding self-modifying code with WRLONG — Parallax Forums

PASM Beginner question regarding self-modifying code with WRLONG

Alex.StanfieldAlex.Stanfield Posts: 198
edited 2011-02-24 09:05 in Propeller 1
Hi there, I've been trying last night to get a block of longs written back to a SPIN DAT block with no success.
I designed the communication between SPIN and PASM through a DAT block which according to the manual should do Ok (i.e: the same DAT variable gets used by SPIN in hub ram and the copied local versi

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-02-24 08:53
    "@cs_sts" isn't what you think. Read the descriptions of the "@" and "@@" operators in the Propeller Manual. Essentially, writing "@cs_sts" in a DAT block produces the address of cs_sts relative to the start of the object's DAT area(s), not the address in hub memory. It may seem odd, but it's a result of the way the Spin compiler allocates storage.

    Solutions all involve setting cs_ptr from Spin code during initialization or passing the address of the hub ram area in the PAR register when the assembly code is started with COGNEW.
  • Alex.StanfieldAlex.Stanfield Posts: 198
    edited 2011-02-24 09:05
    Thanks a lot Mike!

    Wow! That was fast! 7 minutes from problem to solution :thumb:

    I'll try it tonight. Great thing the forum is around.

    Regards, Alex
Sign In or Register to comment.