Patent ID: 7580967
Filing Date: 2009-08-25
Classification: G06F

Abstract:
1. A computer implemented method of limiting a double length variable to a maximum value comprising the steps of: storing a set of most significant bits of a maximum value in a first memory location; storing a set of least significant bits of said maximum value in a second memory location; storing a set of most significant bits of the double length variable in a first data register of a set of data registers; storing a set of least significant bits of the double length variable in a second date register of said set of data registers; a performing a first subtracting of said set of most significant bits of said maximum value stored in said first memory location from said set of most significant bits of said double length variable stored in said first data register in an arithmetic logic unit; setting a zero flag within said arithmetic logic unit to 1 and setting a negative flag within said arithmetic logic unit to 0 if said first subtracting produces a zero result; setting said zero flag to 0 if said first subtracting produces a non-zero result; setting said negative flag to 1 if said first subtracting produces a less than zero result; setting said negative flag to 0 if said first subtracting does not produce a less than zero result; writing said set of most significant bits stored in said first memory location into said first data register if said first subtracting does not produce a less than zero result; writing said set of least significant bits stored in said second memory location into said second data register if said negative flag is 0 and said zero flag is 0; performing a second subtracting of said set of least significant bits of said maximum value stored in said second memory location from said set of least significant bits of said double length variable stored in said second data register in said arithmetic logic unit; and writing said set of least significant bits stored in said second memory location into said second data register if said second subtracting produces a greater than zero result.