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.
Memory — src buffer (1000–1031) · results are written back here
Memory — src2 buffer (2000–2031) · second addends, read-only
CPU — registers
srcq src pointer1000
src2q src2 pointer2000
widthq offset and counter32
FLAGS:—
m0empty
m1empty
read window [srcq+widthq]written back (+10)window marker