Page 1 of 1

Code processing (only) upon input change

PostPosted: Wed Nov 30, 2016 8:15 am
by Rocko
Hi,

I'm working with 'blue code' calculation, in which the input is (say): A,B,C and output is X,Y,Z.

I would like the code to process ONLY if A,B or C have changed and for a single code flow.
I remember (from the synthmaker) forum using such a technique, by converting from 'blue code' to assembley and adding a unique code.

But -I couldn't find examples in the new forum.
Can anyone please re-explain this method ?

Appreciated

Re: Code processing (only) upon input change

PostPosted: Wed Nov 30, 2016 3:59 pm
by KG_is_back
you basically need to use conditional jump

Code: Select all

//code that checks whether inputs changed
//result is in "temp" variable

mov eax,temp[0];
cmp eax,0; //compare with zero
jz theEnd; //jump if equal

//code that you want to skip

theEnd:

//additional code you don't want to skip


It should be easy to check where the "checking code" ends. It should end with "movaps temp,xmm?;" (where ? is 0-7)
To be sure, just check where the code ends when only the "checking code" is present in the code module.