Unsigned 32-bit integers
Posted: Wed Nov 27, 2013 5:40 pm
Hi there community!
I've been playing around with inline assembly more and more lately, and I've
been wondering; How can I perform several calculations in fASM and keep the
working variables unsigned? I don't care if the end result which will be returned
to PureBasic will be a signed integer, but how do I keep it all unsigned in ASM?
e.g. I'm reading a byte from a buffer, I always want it to be unsigned. Then, for
example, I would add this byte value to an int (let's say it's a hashing function),
how do I keep the int (EAX) unsigned throughout the calculations with common
arithmetic / bitwise operations? It's quite problematic when it comes to addition
and subtraction.
It could be something so obvious and I'm missing a world of simple facts here, but
I'd love some light being shed on my question.
Thanks all, have a nice day!
I've been playing around with inline assembly more and more lately, and I've
been wondering; How can I perform several calculations in fASM and keep the
working variables unsigned? I don't care if the end result which will be returned
to PureBasic will be a signed integer, but how do I keep it all unsigned in ASM?
e.g. I'm reading a byte from a buffer, I always want it to be unsigned. Then, for
example, I would add this byte value to an int (let's say it's a hashing function),
how do I keep the int (EAX) unsigned throughout the calculations with common
arithmetic / bitwise operations? It's quite problematic when it comes to addition
and subtraction.
It could be something so obvious and I'm missing a world of simple facts here, but
I'd love some light being shed on my question.
Thanks all, have a nice day!