@ -----------------------------------------------------------------------------
  Wortbirne Flag_visible, "pulseconvolution" @ ( sample# -- intensity )
@ -----------------------------------------------------------------------------
  @ 64 kb contains 32 * 1024 = 32768 samples. 
  @ First sample inside is sample 0
  @ Last  sample in this block is sample 32767.
  @ Subtract length of convolution filter: 32767 - 480 = 32287
  @ If this border is crossed, the long split-buffer aware filtering has to be used.

  movw r0, #32287
  cmp tos, r0 @ #32287 @ Deep enough into lower buffer to not cross the border ?
  bls.n fast_convolution @ Sample 0 to 32287

  cmp tos, #32768 @ Inside upper buffer ?
  bls splitbuffer_convolution @ Unsigned lower or same, sample 32288 to 32767:

fast_convolution:
  lsls tos, #1
  subs r2, tos, #0x10000 @ $8000 shl 1
  ite hs
    addhs tos, r2, #0x20000000
    addlo tos,     #0x10000000

  .include "filter-fast.s" @ This is the filter code when no buffer crossing is necessary.
  
splitbuffer_convolution:
  .include "filter.s" @ This is automatically generated for crossing the buffer boundary.
 
