Need Help Understanding ORG Directive
I'm working on a serial interface program for my Propeller 2 chip. ORG seems like a really simple directive, but lately I've become confused on how to use it properly. For my PASM2 program, I want to store the program data in general purpose RAM in cog 0. In my mind you would simply write "ORG $000" at the beginning of the program code.
However, when I write "ORG $000" in my program, the assembler places the program code at $000 in HUB RAM. I find this confusing because I thought only ORGH could be used to put code/data in HUB RAM.
Additionally, now that I have my serial interface program written, I'd like to store some strings in cog 0's LUT RAM to be used for command recognition and interface responses. At the end of the file containing my program code, I write "ORG $210" and then use the BYTE directive to declare the strings in memory. This only stores the strings immediately after my program data in HUB RAM... Not at address $210 in LUT RAM.
So, my main questions are:
1. Why does ORG store my code in HUB RAM and not general purpose RAM of cog 0?
2. Can I use ORG to store data in LUT RAM or do I need to write PASM2 code to manually load LUT RAM with the data I want?
3. If you can use ORG to store data in LUT RAM, is ORG $200-$3FF the proper way to do so?
4. Can you use ORG more than once in a single PASM2 program file to store different parts of a program in different sections of memory? For example:
' All of my
' cool serial
' interface code.
BTW, I'm using the official Propeller Tool program to view the memory space of my PASM2 programs. That's how I found out all my code was being loaded into HUB RAM. I later verified this when I wrote code to search for my data strings in LUT RAM and found out they were not present. I hope I'm not just misinterpreting the memory map...
Sorry for the long post! Any help would be greatly appreciated.