Hi,
I try to find a good way to save and restore 40-Bit register values (floating point in f0-f15) during an interrupt service routine.
My audio calculations are done in 40-Bit floating point, my SPI communicates with a microcontroller.
The SPI end interrupt is nested with the SPORT interrupt, so I have to save/restore some registers used in the SPI interrupt.
My internal memory is 48Bit code in block 1 and block2/3/4 is 32-Bit data.
Simple copy instructions or puts/gets on f0-f15 (or r0-r15??) are just saving upper 32-Bit of the 40-Bit values.
For status it's simple I think with push/pop sts.
I need 2-3 registers to be stored and recalled in 40-Bit.
Any ideas or proposals?
Thank you
Christian
You must read pages 6-18 and pages from 7-44 to 7-47 of SHARC Processor Programming Reference Includes ADSP-2136x, ADSP-2137x, and ADSP-214xx SHARC Processors Revision 2.4, April 2013.
So if you use:
I0 = address_of_48bit_width_memory;
m5=1;
ustat1 = dm(sysctl);
bit set ustat1 imdw0;
DM(sysctl)=ustat1;
nop;
r0=DM(i0;,5); // you get 40-bit data in r0
I was looking for a simpler solution as I only have some 2-3 specific register to be saved.
My actual solution is now following:
PX = R0;
dm(SAVE_R0_1)=PX1;
dm(SAVE_R0_2)=PX2;
...
and the other way for restoring them.
Regards