Shop OBEX P1 Docs P2 Docs Learn Events
about rdword — Parallax Forums

about rdword

caskazcaskaz Posts: 957
edited 2010-03-09 19:54 in Propeller 1
Hi.
I solved sine-wave by gived advise.
But I have one more question.

I use sin_table_end($F001) to get data for [noparse][[/noparse]90 - 179.95] and [noparse][[/noparse]270 - 359.95]degree.
But it also fine works for $F000).

I checked by using PASM
For example
sin_table($E000)
[noparse][[/noparse]0 - 89.95] $E002 --> $32
$E004 --> $65

sin_table_end($F001)
[noparse][[/noparse]90 - 179.95] $E003 --> $32
$E005 --> $65

Instruction "rdword" is automatically search top addres(even) of word data?

Comments

  • pullmollpullmoll Posts: 817
    edited 2010-03-09 11:57
    caskaz said...
    Instruction "rdword" is automatically search top addres(even) of word data?

    Yes. I stumbled across this today in my own code. The manual says the address' lower bit will be cleared to zero resulting in an address pointing to a word boundary and this means you can load words from addresses divisible by two only. I don't know if perhaps you have to use $f002. The manual's examples say $f001...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    He died at the console of hunger and thirst.
    Next day he was buried. Face down, nine edge first.
  • potatoheadpotatohead Posts: 10,261
    edited 2010-03-09 16:20
    It was my understanding that strict alignment is in play for all the data length types. long = 00, word = 0, byte is just byte.

    Just do [noparse][[/noparse]address] & %00, or %0 to get the effective address for a given fetch from the HUB, and that's how it will work. $F001 will just be $F000. $F002 will be $F002, for words.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    8x8 color 80 Column NTSC Text Object
    Safety Tip: Life is as good as YOU think it is!
  • MagIO2MagIO2 Posts: 2,243
    edited 2010-03-09 19:37
    I did not find code in the manual (V1.1) that accessed $F001. It only says that the sine-table is stored from $E000 to $F001. $E000-$EFFF are 2048 words and $F000/$F001 are the 2049th word. Of course the code which calculates the address will end up in $F000 to fetch the last word.
  • pullmollpullmoll Posts: 817
    edited 2010-03-09 19:54
    MagIO2 said...
    I did not find code in the manual (V1.1) that accessed $F001. It only says that the sine-table is stored from $E000 to $F001. $E000-$EFFF are 2048 words and $F000/$F001 are the 2049th word. Of course the code which calculates the address will end up in $F000 to fetch the last word.

    Yes, it's my bad. I gave the OP a hint from the top of my head, without looking into the manual again. Of course $f001 is used, but it's just the MSB of the word at $f000. D'OH!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    He died at the console of hunger and thirst.
    Next day he was buried. Face down, nine edge first.
Sign In or Register to comment.