Quote Originally Posted by pwhitt
I've run into this problem before. The ~ operator returns a 16 bit result. If you store the result into your one byte var, the upper word is truncated thus removing the uneccesary bits.

I suspect you were doing something like:
HSEROUT ["0-5=", ~Result+1]

If so, that would cause exactly what you describe. The pseudo code posted however does not suffer from this problem.
The problem is:
You are outputting a VAR that has been declared as BYTE with a resolution of 16 bits,
that doesn't make much sense, does it?

Try:
HSEROUT [DEC3 result] ' for Decimal output (3 Digits)

HSEROUT [HEX2 result] ' for Hexadecimal output (2 Digits)

See: Manual Section 5.31