Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: franji1 on May 17, 2013, 02:25:31 PM
-
This question came up recently, and I thought I would post it here so everyone can enjoy the answer ;D.
How do you look at a STRING's data buffer in Hexadecial, not as Text/ASCII???
It’s supported in Data View by changing the STRING element display format. In addition to the default ASCII format for STRING elements, there is Quoted, Hexadecimal, 4 Hex/ASCII (4 characters per row), 8 Hex/ASCII, 16 Hex/ASCII, 24 Hex/ASCII, and 32 Hex/ASCII).
Any of the last Hex/ASCII formats will display all Hex values along with the equivalent ASCII. The Hexadecimal format will display just the Hex BYTE values in the buffer (if that’s all you need). Even the Quoted will display any non-ASCII in their hex equivalent like an escape sequence, "Hello$0D$0A" for the text "Hello" followed by a CR/LF. No programming is needed. No data buffers needed. It’s all there. You can even edit it in Hex using the Quoted format by using the $ escape sequence (e.g. "$0D$0A").
The attachment DataViewStrings2.png is an example of a CR/LF terminated sentence of "The quick brown fox jumped over the lazy dog." (ASCII, Quoted, Hexadecimal, 4 Hex/ASCII , and 16 Hex/ASCII). Note that the ASCII format displays a dot for any non-displayable ASCII (so the trailing CR and LF shows as dots).