Expressions

Top  Previous  Next

Expressions in the program are the mathematical constructions for calculating results with the use of one or more operands. It supports various operations on expressions. The following operands are used:
 

numbers

example of expressions

When a number is required, you may use an expression; <%CM%> will accept the value of the expression. For example, when using the Modify command in the Buffer window, you can enter the new value in the form of a number or arithmetic expression.

Interpreting the expression result

The expression result is interpreted in accordance with the context in which it is used.

In the dialog box, when an address is required, the program tries to interpret the expression’s value as the address. If you enter a variable name, the result of the expression will be the variable’s address but not the value of the variable.

If the dialog expects a number to be entered, the expression’s value will be interpreted as a number (for example, the Modify Memory dialog box of the Buffer Dump window). If you enter a variable name there, then the result will be the value of the variable, but not its address.

Nonetheless, you can follow the default rules:

If you need to use the variable’s value, where an address is expected, then you can write something like var + 0. In this case, the variable’s value will be used in the expression.

If you need to use the variable address, apply the & (address) operation, that is, &var.