Not sure how to best do that conditional subtraction in assembler, but it could be something like One trick on x86 is to precompute the negation of <c1,c0>, since then it will be possible to do the conditional "subtract" using two LEA and two CMOV. -- Torbjörn