a question of hop()
Posted: Sat Jan 19, 2019 2:14 pm
I have a simple question about 'hop()'.
In DSP I might write e.g. hop(32){ // <my code> // }, which if then converted to Assembler would give me
I understand how that works, by and-ing the sample counter (ecx) with 32, which creates a mask that's zero every 32nd sample. So <my code> runs only on samples 0, 32, 64 and so on.
However it has occured to me that if I have, say, two linked modules both set to hop(32) this presumably means that they will both run together on 0, 32, 64 etc.
But if I did this on one of them :
.. would that make this module run on samples 5, 37, 69 etc., thus shareing the load, reducing the log-jam a fraction?
Or am I making an embarrassing error ...
In DSP I might write e.g. hop(32){ // <my code> // }, which if then converted to Assembler would give me
- Code: Select all
mov eax,ecx;
and eax,31;
cmp eax,0;
jnz end;
// <my code> //
end:
I understand how that works, by and-ing the sample counter (ecx) with 32, which creates a mask that's zero every 32nd sample. So <my code> runs only on samples 0, 32, 64 and so on.
However it has occured to me that if I have, say, two linked modules both set to hop(32) this presumably means that they will both run together on 0, 32, 64 etc.
But if I did this on one of them :
- Code: Select all
mov eax,ecx;
add eax,5; //un-sync?
and eax,31;
cmp eax,0;
jnz end;
// my code //
end:
.. would that make this module run on samples 5, 37, 69 etc., thus shareing the load, reducing the log-jam a fraction?
Or am I making an embarrassing error ...