Hi,
I am implementing some timing-critical functions on the Sensor Controller which need to be coded in assembly. I have managed to integrate this in the C Execution Code by implementing a custom resource definition and procedure definition (resource_def, proc_def) and accessing with a function call. This works but I have found the workflow a bit torturous and I also have some questions around the assembly language reference itself.
The first thing is that edits in the procedure definition can only be picked up by restarting Sensor Controller Studio. I have tried disable/enable of the resource, close and reload the project,etc., but only a complete restart recognises changes in the .prd file leading to a very long code/compile cycle. Is there any way to get SCS to re-read the proc_defs without a restart? I am using the latest (2.4.0.793) version of the software.
Regarding the assembly reference, it is clear that certain instructions set/reset flags and that these flags are used in subsequent branches to direct program flow. It is not made explicit how these flags are set, however. Taking the example of the right-shift (lsr) operation which modifies the Z,N,C flags, I assume the following:
- Z is set if Rd == 0x0000 after the shift
- N is set if Rd == 0b1xx...xxx after the shift
- C is set if Rd == 0bxxx...xx1 before the shift
If this is correct then shifts between words (registers) would be possible without a test instruction by branching on the carry condition - is this the case?
A final question is around flags being used by the instructions. It seems that instructions apart from branch (b<cc>) only set flags and do not change operation based on flag state. Is this correct, i.e. there is nothing like an add-with-carry for example?
Regards,
Jamie