Some Clarification
kt88seamp
Posts: 112
Hello,
I used to be a regular user of the Propeller until switched over to FPGAs and other controllers such as ARM units. I have learned a great deal more about digital systems since last year when I was actively involved with the Propeller. I have a much greater understanding of how it works, on a low level, now that I succeeded in engineering my own soft processor in VHDL. Now onto my question.
I am trying to directly upload assembly instructions to the EEPROM and have the Propeller execute them. I will tell you what I am doing this for in the projects section as soon as I completely collect all my thoughts for what I will do. It never hurts to plan your projects well. Basically, I am making a software based interpreter for a scripting language I am creating. The compiler for my scripting language will be written in .NET and, depending on my scripting command, will generate at least one propeller assembly instruction per command. Last year I made a crude version of this system with SPIN commands interpreting my script commands, but this was HORRIBLY inefficient.
My goal is to send propeller assembly commands over RS-232 into the Propeller's 32k I2C EEPROM. A spin routine will then receive the commands with FullDuplexSerial and write them to the EEPROM. Once written, the propeller will reboot, load those instructions into a cog and run them. I will do this by sending the entire 4 bytes of the instruction from the C# program (eg 101000 001i 1111 ddddddddd sssssssss for mov).
For example, lets do a mov immediate of the value 0xFFFFFFFF to cog memory address 0x0A. My first question is: It possible to move a literal value into an address without ascribing a name to it, or in the Propeller's case, making it a register? What would be the syntax for that in propeller assembly. I cannot seem to find it documented anywhere.
As soon as this question is answered, I will ask my next.
I used to be a regular user of the Propeller until switched over to FPGAs and other controllers such as ARM units. I have learned a great deal more about digital systems since last year when I was actively involved with the Propeller. I have a much greater understanding of how it works, on a low level, now that I succeeded in engineering my own soft processor in VHDL. Now onto my question.
I am trying to directly upload assembly instructions to the EEPROM and have the Propeller execute them. I will tell you what I am doing this for in the projects section as soon as I completely collect all my thoughts for what I will do. It never hurts to plan your projects well. Basically, I am making a software based interpreter for a scripting language I am creating. The compiler for my scripting language will be written in .NET and, depending on my scripting command, will generate at least one propeller assembly instruction per command. Last year I made a crude version of this system with SPIN commands interpreting my script commands, but this was HORRIBLY inefficient.
My goal is to send propeller assembly commands over RS-232 into the Propeller's 32k I2C EEPROM. A spin routine will then receive the commands with FullDuplexSerial and write them to the EEPROM. Once written, the propeller will reboot, load those instructions into a cog and run them. I will do this by sending the entire 4 bytes of the instruction from the C# program (eg 101000 001i 1111 ddddddddd sssssssss for mov).
For example, lets do a mov immediate of the value 0xFFFFFFFF to cog memory address 0x0A. My first question is: It possible to move a literal value into an address without ascribing a name to it, or in the Propeller's case, making it a register? What would be the syntax for that in propeller assembly. I cannot seem to find it documented anywhere.
As soon as this question is answered, I will ask my next.
Comments
Apologies, I may have misread what you were trying to say. Huge constants (> 511) have to either be loaded from special locations or you have to construct them with code. It's not always as easy as in the example above. However, I don't see (yet) what would stop you from using the variable/constant pool approach.
mov $00A, #$FFFFFFFF
It would store the $FFFFFFFF in the next memory location and take twice the amount of clock cycles to execute, since it is too big to fit in 9 bits?
Why can't you reference a register location (which would leave you with 2 longs used but only one long used re: code execution)? You're not suggesting that you only ever send a single instruction from the PC? Or is it difficult to construct the PASM image in the first place?
Another lazy approach (to avoid data execution) would be: Having a pool after the code section would obviously be the best solution.
PUB Main
Congnew($8000, 0)
cause the assembly instructions I manually placed into the EEPROM execute?
Storing in EEPROM makes only sense if you need it to be persistent without power.
Andy
<code>
PUB Main
long instrList[1024]
' Run I2C EEPROM read routine.
cognew(@instrList, 0)
</code>
Correct me if the syntax for starting the program stored in this array is incorrect. Also, will I run into trouble since the array is greater than 512 bytes, or will the propeller page the second 512 bytes in?
However a cog running pasm could always load some instructions in some buffer in cog and then run those as an "overlay". Have a search for Cluso's overlay loader.