Formatting Numbers You can use CypherCalc to change the format of numbers, including word sizes, word delimiters, and word order (most significant to least significant). This is handy when cutting and pasting large numbers to/from other applications which may require the number to be formatted differently.

The "Format Numbers" tool is really a text processing function, that filters and formats the text in the "Number to Format" box according to the parameters you specify, then outputs the formatted text to the "Result" box.

Formatting Options

Here's a list of paramters you can specify when formatting numbers. See the example below for more information.

Strip all occurrences of this from input text. CypherCalc will search the "Number to Format" for all occurrences of the text you enter in this box and remove them. Use this for removing word prefixes, unusual delimiters, etc.

Strip 'n' characters from start of every line. CypherCalc will ignore the first n characters in every line of text in the "Number to Format" box. Use this to remove memory addresses, comment delimiters, etc.

Group Input as 8-bit words. The text in the "Number to Format" box will be formatted into a string of 8-bit numbers, regardless of the positions of any word delimiters.

Group Input as 16-bit words. The text in the "Number to Format" box will be formatted into a string of 16-bit numbers, regardless of the positions of any word delimiters.

Group Input as 32-bit words. The text in the "Number to Format" box will be formatted into a string of 32-bit numbers, regardless of the positions of any word delimiters.

Words per line. Enter the number of words each line of output result text should contain. A carriage return and line feed will be appended to the end of each line.

Prefix words with... Each word in the output result will be prefixed with any text you enter into this box. Use this to enter radix specifiers, such as "0x" for hex, etc.

Postfix words with... Each word in the output result will be suffixed with any text you enter into this box. Use this to enter radix specifiers, such as "H" for hex, etc.

Prefix lines with... Each line in the output result will be prefixed with any text you enter into this box.

Output Delimiter. Choose whether words in the output result will be separated by a coma, a space, or a comma and space.

Exchange word positions, most-significant to least-significant. Checking this box will reverse the word order of the input number, most-significant to least-significant.


An Example

Formatting Numbers Example Suppose we have a 512-bit number displayed in our debugger's memory dump as shown at right. We wish to format this number so we can paste it into a C-source code file. The memory dump shows the number with least-significant word first (at memory address 1200) and most-significant word last (at address 121D). Suppose our C-code requires the words in the opposite order (most-significant first, least-significant last), and that they be prefixed with "0x" to indicate hex, and be comma-delimited.

We'll need to strip the memory addresses from each line of input text. These addresses are four digits long, plus a colon (:) and a space ( ) for a total of six characters. We'll also need to exchange the order of the words, add a "0x" to the start of each word, and delimit the words with a comma. The figure at the top of this page shows the settings for the "Format Numbers" tool that will accomplish this.



| Home | Features | Tools | Programming | System Requirements | Ordering Info |