Debugging Tools for Windows

Assemble

The Assemble and AssembleWide methods assemble a single processor instruction. The assembled instruction is placed in the target's memory.

HRESULT
  IDebugControl::Assemble(
    IN ULONG64  Offset,
    IN PCSTR  Instr,
    OUT PULONG64  EndOffset
    );

HRESULT
  IDebugControl4::AssembleWide(
    IN ULONG64  Offset,
    IN PCWSTR  Instr,
    OUT PULONG64  EndOffset
    );

#ifdef UNICODE
#define AssembleT AssembleWide
#else
#define AssembleT Assemble
#endif

Parameters

Offset
Specifies the location in the target's memory to place the assembled instruction.
Instr
Specifies the instruction to assemble. The instruction is assembled according to the target's effective processor type (returned by SetEffectiveProcessorType).
EndOffset
Receives the location in the target's memory immediately following the assembled instruction. EndOffset can be used when assembling multiple instructions.

Return Value

S_OK
The method was successful.

These methods can also return error values. See Return Values for more details.

Interface Version

Assemble is available in all versions of IDebugControl. AssembleWide is available in IDebugControl4 and later versions.

Comments

The assembly language depends on the effective processor type of the target machine. For information about the assembly language, see the processor documentation.

Note: The Assemble and AssembleWide methods are not supported on some architectures, and on some other architectures not all instructions are supported.

The assembly language options—returned by GetAssemblyOptions—affect the operation of this method.

For an overview of using assembly in debugger applications, see Debugging in Assembly Mode. For more information about using assembly with the debugger engine API, see Assembling and Disassembling Instructions.

Requirements

Headers: Defined in Dbgeng.h. Include Dbgeng.h.

See Also

Disassemble, GetAssemblyOptions, a (Assemble)

Build machine: CAPEBUILD