Pointer offset trickery: one register as both offset and counter
Shift the pointers to the end of the buffer, negate width — and the loop runs until widthq crawls up to zero. No cmp, no separate counter.
Where the load points — [srcq + widthq]
[
srcq—
+
widthq—
]=
address—
srcq has been moved past the end of the buffer in advance, so a negative widthq brings the address back inside. widthq grows toward zero — the window slides right.