But that's not really "standard" is it? I'd probably stick to the normal two's complement standard.
Subtract the value from 256 (if the variable is byte sized) and print a - in front. But really, for presentation purposes etc PBP already supports that with the SDEC modifier.
If you need to multiply two numbers (A) and (B) where one (B) can be negative thenCode:A VAR WORD B VAR WORD Sign VAR BIT A = 10 B = -5 Sign = B.15 Result = A * ABS(B) Result.15 = Sign LCDOUT SDEC Result
Bookmarks