(ISTBC? Never encountered the acronym)
ISTBC = "I stand to be corrected", i.e., a caveat that my memory may be failing me!
these days I don't often use assembly language except at specific pinch points
same.. for example a 16/32 point Antialiasing FIR..cc the microchip dsp libary require 61 cycles just for setup.. or this is what the manual says.
I don't understand why,
-pushing and popping all the needed WREGs is like 12 instructions total.
-another dozen to set up the circular buffers
-one clear with prefetch + 16/32 MACs
-one to retreive the result from the accumulator
so i use my own function.
I haven't done much in recent years with dsPIC, but pretty much across the entire PIC range for exceptionally low latency interrupt handling I've found I sometimes have to hand craft ISR prolog and epilog code, even when the part has shadow registers.
asm ("mov __s16DCQCorr,W8": : : "w8")
could you explain how this gets translated? my knowledge of dspic assembler is just this much..
This is GCC syntax and to be honest this syntax came to me relatively recently compared to my assembly language career, so I am certainly no expert in it, pretty much most of my knowledge of it comes from looking at others' examples, I should spend more time looking at the manual! The code example I gave I wrote over seven years ago!
There's a 16 bit global C RAM variable called __s16DCQCorr, the contents of which are moved in the W8 register.
int16_t __s16DCQCorr=0;
Specifying the "w8" at the end there tells the compiler that the W8 register is clobbered, i.e. overwritten, by my assembly language, so it takes that into account when compiling any C code around my ASM.
In retrospect, it would probably be better (more correct) to write it like this:
asm ("mov %0,W8": :"U" (__s16DCQCorr) : "w8")
This tells it explicitly that the variable is near.
If you overwrite several registers, then you can list them, comma separated, for example:
asm ("mul.ss W6,W0,W2": : : "w2","w3"); // W3:W2 has I * PhaseCorr
The MUL generates a 32 bit result, so clobbers two 16 bit registers, shown in the clobber list.
As stated, I am no expert in this GCC syntax, sometimes I find it easier to write the code directly into a .s.