SourcePoint Intel Help

Table of Contents

define

Create a debug object.

Syntax

define debug-proc

define [global] data-type name [=expr]

define [global] data-type name [array-size]

Where:

debug-proc

specifies a debug procedure definition.

name

specifies a unique, user-defined name for the object being defined.

global

indicates that a debug variable is globally recognized. Data types are global unless defined inside a debug procedure.

data-type

specifies an emulator data type.

expr

is an expression that assigns an initial value to the object.

array-size

is an expression indicating the size of a debug variable array.

Discussion

Use the define command to define a debug variable or a debug procedure.  A debug object name cannot be the same as a reserved keyword in the command language. If the name specified is the same as a previously defined debug object, then that object is overwritten.

An initial value may be assigned to a debug variable. If no initial value is specified, the variable is assigned a default value, depending on its data type:

Type

Default Value

ordn, intn

0

nstring

""

bool

false

ptr

invalid

Arrays of debug variables can also be created. For more information see Debug Variables.  For more information on defining a debug procedure, see Debug Procedures.

Example 1

To define a debug variable:

Command input:

define int2 max = 400
max

Result:

0400H

Example 2

The following example shows how to define a procedure named "power." This proc returns the result of a value and its exponent.

Command input:

define proc power(arg1, arg2)

define int1 arg1

define int1 arg2

{

   define int1 index

   define ord4 result = 1

   for (index = 1 ; index <= arg2 ; index += 1)

      result = result * arg1

   return result

}

power(2,4)            // execute the proc

Result:

16T

Related Topics: