# Bit Shift Operations Restored

Bit shifting moves binary digits left or right, equivalent to multiplying or dividing by powers of 2.

| Opcode         | Input | Output | Restored Function        |
| -------------- | ----- | ------ | ------------------------ |
| **OP\_LSHIFT** | x n   | x<\<n  | Shifts x left by n bits  |
| **OP\_RSHIFT** | x n   | x>>n   | Shifts x right by n bits |

**Practical applications:**

* **Efficient multiplication/division by 2:** Shifting left by 1 bit doubles a number
* **Bit masking:** Extracting specific bits from data structures
* **Binary protocols:** Processing flags and binary-encoded information


---

# 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://hub.bsvblockchain.org/higher-learning/bsv-academy/bsv-opcodes/historical-opcodes-and-chronicle-restoration/bit-shift-operations-restored.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.
