Conversation
1 task
klaudiagrz
reviewed
Mar 14, 2026
content/asm_4.md
Outdated
| - `div` and `idiv` - Unsigned and signed division. Both instructions take a single operand. The value of this operand is divided by the value of the `rax` register. The place where the result is stored depends on the size of the operands. In the case of 8-bit operands, the result is stored in the `al:ah` pair. In the case of 16-bit operands, the result is stored in the `dx:ax` pair. For 32-bit operands, the result is stored in the `edx:eax`, and in the case of 64-bit operands, the result is stored in the `rdx:rax` pair. | ||
| - `add` - Addition. It adds the value of the second operand to the first and stores the result in the first operand. | ||
| - `sub` - Subtraction. It subtracts the value of the second operand from the first and stores the result in the first operand. | ||
| - `mul` and `imul` - Unsigned and signed multiplication. Both instructions take a single operand. It multiples the value of the single operand by the value stored in the `rax` register or it its part. The part where the result is stored depends on the size of the operands. |
Collaborator
There was a problem hiding this comment.
Suggested change
| - `mul` and `imul` - Unsigned and signed multiplication. Both instructions take a single operand. It multiples the value of the single operand by the value stored in the `rax` register or it its part. The part where the result is stored depends on the size of the operands. | |
| - `mul` and `imul` - Unsigned and signed multiplication. Both instructions take a single operand. It multiplies the value of the single operand by the value stored in the `rax` register or its part. The part where the result is stored depends on the size of the operands. |
content/asm_4.md
Outdated
Comment on lines
+69
to
+72
| - For 8-bit operands, the value from the `al` register is multiplied by the operand and the result is stored in the `ax` register. | ||
| - For 16-bit operands, the value of the `ax` register is multiplied and the result is stored in the `dx:ax` register pair. | ||
| - For 32-bit operands, the value of the `eax` register is multiplied and the result is stored in the `edx:eax` register pair. | ||
| - For 64-bit operands, the value of the `rax` is multiplied and the result is stored in the `rdx:rax` register pair. |
Collaborator
There was a problem hiding this comment.
Suggested change
| - For 8-bit operands, the value from the `al` register is multiplied by the operand and the result is stored in the `ax` register. | |
| - For 16-bit operands, the value of the `ax` register is multiplied and the result is stored in the `dx:ax` register pair. | |
| - For 32-bit operands, the value of the `eax` register is multiplied and the result is stored in the `edx:eax` register pair. | |
| - For 64-bit operands, the value of the `rax` is multiplied and the result is stored in the `rdx:rax` register pair. | |
| - For 8-bit operands, the value from the `al` register is multiplied by the operand, and the result is stored in the `ax` register. | |
| - For 16-bit operands, the value of the `ax` register is multiplied, and the result is stored in the `dx:ax` register pair. | |
| - For 32-bit operands, the value of the `eax` register is multiplied, and the result is stored in the `edx:eax` register pair. | |
| - For 64-bit operands, the value of the `rax` register is multiplied, and the result is stored in the `rdx:rax` register pair. |
content/asm_4.md
Outdated
Comment on lines
+74
to
+77
| - For 8-bit operands, the value of the `ax` register is divided by the operand, the quotient is stored in the `al` register, and the remainder in the `ah` register. | ||
| - For 16-bit operands, the register pair `dx:ax` is divided, the quotient is stored in the `ax` register, and the remainder in the `dx` register. | ||
| - For 32-bit operands, the register pair `edx:eax` is divided, the quotient is stored in the `eax` register, and the remainder in the `edx` register. | ||
| - For 64-bit operands, the register pair `rdx:rax` is divided, the quotient is stored in the `rax` regiter, and the remainder in the `rdx` register. |
Collaborator
There was a problem hiding this comment.
Suggested change
| - For 8-bit operands, the value of the `ax` register is divided by the operand, the quotient is stored in the `al` register, and the remainder in the `ah` register. | |
| - For 16-bit operands, the register pair `dx:ax` is divided, the quotient is stored in the `ax` register, and the remainder in the `dx` register. | |
| - For 32-bit operands, the register pair `edx:eax` is divided, the quotient is stored in the `eax` register, and the remainder in the `edx` register. | |
| - For 64-bit operands, the register pair `rdx:rax` is divided, the quotient is stored in the `rax` regiter, and the remainder in the `rdx` register. | |
| - For 8-bit operands, the value of the `ax` register is divided by the operand, the quotient is stored in the `al` register, and the remainder is stored in the `ah` register. | |
| - For 16-bit operands, the register pair `dx:ax` is divided, the quotient is stored in the `ax` register, and the remainder is stored in the `dx` register. | |
| - For 32-bit operands, the register pair `edx:eax` is divided, the quotient is stored in the `eax` register, and the remainder is stored in the `edx` register. | |
| - For 64-bit operands, the register pair `rdx:rax` is divided, the quotient is stored in the `rax` register, and the remainder is stored in the `rdx` register. |
This commit adds the missing instructions and better description for the `mul`, `imul, `div`, and `idiv` instructions. Thank you to @sevilla-larry for report. Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
103b9a1 to
18bcfc8
Compare
klaudiagrz
approved these changes
Mar 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This commit adds the missing instructions and better description for the
mul,imul,div, andidiv` instructions.Thank you to @sevilla-larry for report.
Related issues
#80