If you wanted to save the last 20 audio samples, you might use something like
MICSAVE (MICPOS+MICSIZE-20) MOD MICSIZE, 20, ARRAY
However, this will fail if, say, MICSIZE was 100 and MICPOS was 90.
SB records audio into a circular buffer, but for some reason MICSAVE doesn't act like RINGCOPY
You need to use MICSAVE twice when MICPOS is near the end of the buffer:
DEF MICSAVE2 START,LENGTH,ARRAY
START=START MOD MICSIZE
VAR REMAINING=MICSIZE-START
IF REMAINING>=LENGTH THEN
MICSAVE START,LENGTH,ARRAY
ELSE
MICSAVE START,REMAINING,ARRAY
VAR EXTRA=LENGTH-REMAINING
DIM TEMP[EXTRA]
MICSAVE 0,EXTRA,TEMP
COPY ARRAY,REMAINING, TEMP,EXTRA
ENDIF
END