Shop OBEX P1 Docs P2 Docs Learn Events
Reading an address in RAM/ROM — Parallax Forums

Reading an address in RAM/ROM

TappermanTapperman Posts: 319
edited 2010-01-23 05:08 in Propeller 1
Hello All,

· Is there an equivelant to PEEK/POKE in RAM/ROM in the propeller?· I saw in assembly a RDBYTE, RDWORD, RDLONG .. but I'm not sure what to use in SPIN?

Thanx in advance for you help!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-23 00:57
    BYTE, WORD, and LONG are the equivalents. They're fairly well described with examples in the Propeller Manual.
  • TappermanTapperman Posts: 319
    edited 2010-01-23 01:48
    Mike Green said...
    BYTE, WORD, and LONG are the equivalents.
    I tried that in a piece of code earlier, but didn't trust the results.· See attached code.

    Had me confussed.· roll.gif
  • BradCBradC Posts: 2,601
    edited 2010-01-23 02:05
    It looks like you are shuffling the pointer along by 1 byte each time around the loop, but you are accessing word data (2 bytes).

    Try

    Entry := Word[noparse][[/noparse] ST ][noparse][[/noparse] I ]

    *or*

    Entry := Word[noparse][[/noparse] ST + I << 1 ]

    <edit> That first one was not displaying the second brackets <grumble>

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.

    Post Edited (BradC) : 1/23/2010 5:25:27 AM GMT
  • TappermanTapperman Posts: 319
    edited 2010-01-23 04:52
    Now that makes sense! Why is it I miss things like that! It's so simple, I am ashamed.
  • evanhevanh Posts: 16,147
    edited 2010-01-23 05:08
    Warm fuzzies ...
Sign In or Register to comment.