This comment:
; ------------------------------------------------------------
; Entering the function
; ------------------------------------------------------------
is a little useless; it's it quite obvious that the start of the function/subroutine is right there.
However, the rest of your comments are very detailed and very well placed.
Don't use dec
; using sub REG, 1
is faster.
dec
runs in 1 CPU cycle. sub REG, 1
runs in half a CPU cycle.
Other than that, I'm not too familiar with xmm
registers and the instructions that go with them.
However, as I look into them, if any improvements pop into my head, I'll update my post.