Need help creating a pointer to a COG RAM block in PASM
Mike G
Posts: 2,702
I'm simply trying to fill a buffer in COG ram using a pointer. The following PASM code works but I want to use a pointer so I can increment and decrement.
I've been sitting here for a couple hours trying to figure out the syntax. I though this would be really easy. I read the Propeller manual ( I don't know how many times to date) and I tried a forum search. I must be missing a concept or I'm not using the correct language.
Thanks for any help.
... mov rxBuffer, #1 mov rxBuffer+1,#2 rxBuffer res 64
I've been sitting here for a couple hours trying to figure out the syntax. I though this would be really easy. I read the Propeller manual ( I don't know how many times to date) and I tried a forum search. I must be missing a concept or I'm not using the correct language.
Thanks for any help.
Comments
You have 2 options that can accomplish the same thing by modifying the MOV instruction.
The first option is to keep the address pointer in a long and use a MOVS or MOVD to copy the address to the source or destination of your MOV instruction.
The second option is to add (or subtract) %1 for the source address, or %1000000000 for the destination address of the MOV instruction.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
8x8 color 80 Column NTSC Text Object
Safety Tip: Life is as good as YOU think it is!
I get the idea... a little foggy. So I have some work to do.
I really appreciate the help.
In the case of the propeller, the instruction IS the pointer, in that the source and destination bit fields hold the actual memory values to be moved, and they are simply changed on each loop through the block copy.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
8x8 color 80 Column NTSC Text Object
Safety Tip: Life is as good as YOU think it is!
Yeah, I get it now. My mind was set on something like the wrbyte instruction.
I don't know how many times I read Page 312 (MOVD) to 314 (MOVS) in the propeller manual. It didn't click until I worked through Mike Green's example and read your explanation a few times.
Thanks again.