# hx\_UserDefinedCall

## Description

Decompile as call. This commands configures a function call the current instruction should be replaced by in the pseudocode output.

Special names can be used to access operands of the current instructions: \_\_OP1, \_\_OP2, ... for first, second, etc. operands. Each function argument having a name like that will be replaced in the call by the value of the corresponding operand of the instruction. Also if the function name has this format, a call to the location pointed by the corresponding operand will be generated. Other arguments and the return value will be placed into locations derived from the function prototype according to the current compiler, calling convention, argument and return types. You can use IDA-specific *\_\_usercall* calling convention to specify arbitrary locations independently of platform and argument/return types (read IDA help pages about the user defined calling conventions for more info).

**Examples**

* We could ask to replace the following instruction: `out 2b, ax` by specifying the following prototype: `void OUT(unsigned int8 __OP1, int16 __OP2)` which would lead to the following decompiler output: `OUT(0x2b, v1);` where v1 is mapped to ax.
* The following prototype: `int __usercall syscall@<R0;>(int code@<R12;>, void *a1@<R0;>, void *a2@<R1;>)` applied to the second instruction in the following piece of code: `mov r12, #0x148` `svc 0x801` will generate the following pseudocode: `v3 = syscall(328, v1, v2);` where v1, v2, v3 are mapped to R0, R1, R2 respectively.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hex-rays.com/ida-actions/hx_userdefinedcall.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
