# x86-64: 0x0F Prefix - Two-Byte Opcode

A single byte opcode can offer 256 possibilities of instructions, but we have tens of thousands of instructions and extensions now. There's no magic. The way of achieve such goal is called a Two-Byte Opcode. On x86-64, `0x0F` indicates that the upcomming instruction's opcode consists of two bytes.

## `0x0F` "Prefix"

An x86-64 instruction is encoded like this

| Prefix | Opcode | Other Garbage |
| ------ | ------ | ------------- |

You might think that `0x0F` is a prefix. But rather than a *prefix* defined by x86-64, it's an opcode prefix. So the way it works is that once you read an opcode starts with `0x0F`, you should read the upfollow 2 bytes as the opcode.

A two-byte opcode is formated as

| 0x0F Prefix | Primary Opcode | Secondary Opcode |
| ----------- | -------------- | ---------------- |

Take an example of `vmlaunch` from Intel VT, the opcode is `0F 01 C2`, so the encoding is

| 0x0F Prefix | Primary Opcode | Secondary Opcode |
| ----------- | -------------- | ---------------- |
| `0F`        | `01`           | `C2`             |


---

# 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://nskernel.gitbook.io/kernel-play-guide/architectural/x86-64-0x0f-prefix-two-byte-opcode.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.
