The Arithmetic Dialog

This dialog, invoked from the Operations/Arithmetic... menu item, allows you to specify an arithmetic operation to be performed on the file.


The radio buttons on the 'Operate On' box allow you to choose whether to apply the arithmetic to the whole file, or only to areas that are currently marked. Marked areas that are smaller than the type being operated on are ignored; so if you choose an operation to be performed on long integers, a marked area only 3 bytes long will be unaffected.

The 'Operator' listbox contains the various operations that can be performed. Most of these are self-explanatory. For instance, 'Add' adds the Operand to the values found in the document. 'Set to 0 if less than' sets data in the document ot 0 if its current value is less than the operand. 'Truncate high values' sets the data to equal the operand, if it was previously greater than the operand. 'Fill low values' is the reverse, setting data to equal the operand if it was previously higher.

The 'Operand' field allows a number to be entered (it will be interpreted as hex if the adjacent 'Hex' box is checked). This number is applied to the data in the document differently depending on the Operation selected.

The 'Treat Data As' listbox contains a list of types. The data in the document will be interpreted as the type specified here when the arithmetic operation is performed.

When 'OK' is clicked, AXE goes through the document performing the appropriate operations and writing data back to the document. For instance, one could XOR every byte in the document with a given value, or multiply every marked floating-point number by a given value.


Note that each arithmetic operation performed is entered into the undo list separately. Performing an operation on each byte in a large document can therefore fill up the undo list. You may want to make a copy of the document (with File/Save Copy...) in case you want to revert to the old state again.