hi, im new to the forums and fasm
im in the need of limiting a variable's contents to a certain range.
i thought about using a macro for this but a function would do just fine, its the method that im after rather than the package.
what I don't know is how to write an efficient bound routine. having the variable contents and checking for min and max, limiting to this range. what would be the most efficient way of doing this? is there a specific instruction that isn't in sse or similar extended sets?
its clear that i want to do this with pixel data to bound it into 8bits while working on 32bits but i'm using just normal x86 instructions...
it would be cool to learn about the most efficient method in, say, sse too.
are there any examples or instructions I could learn from?
thanks.