x86 assembly multiply and divide instruction operands, 16-bit and higher

后端 未结 1 1639
感动是毒
感动是毒 2021-02-20 18:58

I\'m rather confused about how the multiply and divide operations work in x86 assembly. For example, the code below doesn\'t seem too difficult since deals with 8-bit.

8

相关标签:
1条回答
  • 2021-02-20 19:05

    A quick glance at the documentation shows that there are 4 possible operand sizes for MUL. The inputs and outputs are summarized in a handy table:

    ------------------------------------------------------
    | Operand Size | Source 1 | Source 2   | Destination |
    ------------------------------------------------------
    | Byte         | AL       | r/m8       | AX          |
    | Word         | AX       | r/m16      | DX:AX       |
    | Doubleword   | EAX      | r/m32      | EDX:EAX     |
    | Quadword     | RAX      | r/m64      | RDX:RAX     |
    ------------------------------------------------------
    
    0 讨论(0)
提交回复
热议问题