Memory Operators

A memory operator is a unary operator that returns the result of a direct memory operation. The memory operators are BY, WO, and DW. The C and C++ expression evaluators add the memory operators to the operators in the C and C++ languages. The memory operators are used mainly to debug assembly-language code.

Syntax

{BY|WO|DW} address

The BY operator returns a short integer that contains the first byte at address. This operator simulates BYTE PTR.

The WO operator returns a short integer that contains the value of the word (two bytes) at address. This operator simulates the Microsoft Macro Assembler WORD PTR operation. The DW operator returns a long integer that contains the value of the first four bytes at address. This operator simulates DWORD PTR.

The examples that follow use the Display Expression (?) command, which is described on page 477. The x format specifier used in some of these examples causes the result to be displayed in hexadecimal.

Examples

The following example displays the first byte at the address of the variable sum.

>? BY sum

101

The following example displays the byte pointed to by the BP register with a displacement of 6.

>? BY bp+6,x

0042

The following example displays the first word at the address of the variable new_set.

>? WO new_set

13120

The following example displays the word pointed to by the stack pointer (the last word pushed onto the stack). Because the stack pointer (SP) offset register is used with no segment address, the stack segment (SS) register is assumed.

>? WO sp,x

2F38

The following example displays the doubleword at the address of sum.

>? DW sum

132120365

The following example displays the doubleword pointed to by the SI register. Because the SI index register is used without specifying a segment address, the DS register is assumed.

>? DW si,x

3F880000