Shop OBEX P1 Docs P2 Docs Learn Events
Reading ROM — Parallax Forums

Reading ROM

DFDF Posts: 10
edited 2010-09-28 06:56 in Propeller 1
I am trying to read the values in the sine table located in memory location $E000..$F001 in spin and output them to a serial terminal. I've monkeyed around with this for awhile, but am still very green to the prop. Can you set a variable to a specific memory location and not the hex value of E000..F001 in spin?
thAnks In AdvAncE

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-09-16 15:29
    You can refer to a memory location by using LONG[], WORD[], and BYTE[] depending on the size of the value you want to access. For a long (32-bit) value at location $E000, use LONG[$E000]. I think the sine table consists of 16-bit words, so you'd use WORD[$E000] for those.
  • max72max72 Posts: 1,155
    edited 2010-09-16 23:27
    Check this object:

    http://obex.parallax.com/objects/627/

    Massimo
  • DFDF Posts: 10
    edited 2010-09-23 11:34
    Mike Green wrote: »
    You can refer to a memory location by using LONG[], WORD[], and BYTE[] depending on the size of the value you want to access. For a long (32-bit) value at location $E000, use LONG[$E000]. I think the sine table consists of 16-bit words, so you'd use WORD[$E000] for those.

    How do you set a variable to these memory locations? I tried x=:word[$E000] but just got the decimal value of $E000 instead of the first sine value in the sine table.
  • DFDF Posts: 10
    edited 2010-09-23 11:34
    max72 wrote: »
    Check this object:

    http://obex.parallax.com/objects/627/

    Massimo

    I had already found this object and it helped quite a bit thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2010-09-23 12:19
    VAR word x

    x := word[$E000]

    This works. The first value is 0.
  • DFDF Posts: 10
    edited 2010-09-28 06:56
    PERFECT!! Thanks so much for your help
Sign In or Register to comment.