SourcePoint Intel Help

Table of Contents

evalprogramsymbol

Return the value of the symbol.

Syntax

[result =] evalprogramsymbol(symbol)

Where:

result

specifies an nstring variable to which the function return value is assigned. If result is not specified, the return value is displayed on the next line of the screen.

symbol

is a constant string or nstring specifying the symbol to look up.

Discussion

The evalprogramsymbol function searches each program loaded in the current context for the specified symbol. If the symbol is found, its value is returned. Otherwise, an error message is displayed.

The value returned for a data symbol (variable) is its current state in the target. The value of a code symbol is its address.

Examples

The following examples demonstrate the evalprogramsymbol function. Here it is assumed that a program is loaded that contains the data symbol mydata with a value of '7' and a procedure symbol mycode at address C0008000

Example 1

Command input:

EvalProgramSymbol("mydata")

Result:

7

Example 2

Command input:

define nstring s = "mydata"
EvalProgramSymbol(s)

Result:

7

Example 3

Command input:

EvalProgramSymbol("mycode")

Result:

0xC0008000

Example 4

Command input:

EvalProgramSymbol("test")

Result:

Error "test" is not a program symbol

Related Topics: