When you use the HEX modifier with SEROUT, DEBUG, LCDOUT, HSEROUT, ARRAYWRITE and so on it converts FROM a numeric value TO an ASCII string representing the numeric value as hexadecimal. In other words a value of 127 becomes a "7" and a "F".
Likewise, when you use the HEX modifier with SERIN, DEBUGIN, HSERING, ARRAYREAD etc it converts FROM an ASCII string (or single character) representing a numeric value as hexadecimal TO the actual numeric value. In other words the "7" and the "F" becomes 127.
mpgmike does a good job of explaining how you convert ASCII to the numeric value that the "text" represents but what I'm trying to say is that you don't have to do that "manually" because the HEX- (and DEC and BIN) modifiers works both ways and does the job for you when used with a command that supports them (which DEBUGIN does).
It would be interesting to see if any benefits (size- or speedwise) can be gained from doing the conversion "manually" instead of letting PBP handle it for you using the built in modifiers.
Happy new year by the way!
/Henrik.
Bookmarks