Pointer arithmetic in Propeller assembly - is memory byte-addressable or only l
Dennis Ferron
Posts: 480
Is the RAM in Propeller assembly byte addressable, or does everything have to happen in 32-bit increments? For instance, if I am pointing at one long, and want to advance to the next, would I say "add ptr, #4" (four bytes) or would I say, "add ptr, 1" (one long)? If I'm pointing at the 100th long from 0, is the literal value of that pointer "100" (one-hundred longs past 0) or is it "400" (the four-hundredth byte)?
Comments
When a byte is addressed (RD/WRBYTE) the entire pointer is used.
When a word is addressed the last bit of the pointer is X (dont care).
When a long is addressed the last 2 bits are X.
So when interating through hub memory, bytes are 1, words are 2 and longs are 4.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
hub ram is byte, word, and long addressable with bytewise numbering, I think I read in a thread that alignment is enforced for word and longs though, not 100% sure on that though
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who says you have to have knowledge to use it?
I've killed a fly with my bare mind.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com