Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to multiply 2 bytes and place into AX?

bridger31bridger31 Member Posts: 7
I am trying to figure this whole thing called x86 assembly...specifically I am looking for some insite on how to multiply 2 bytes (AL and BL) and then place the result into AX. Is it as simple as using MUL AL,BL and the moving result into AX? Any help in the right step is appreciated.

Comments

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : I am trying to figure this whole thing called x86
    : assembly...specifically I am looking for some insite on how to
    : multiply 2 bytes (AL and BL) and then place the result into AX. Is
    : it as simple as using MUL AL,BL and the moving result into AX? Any
    : help in the right step is appreciated.

    I think it's simpeler than you thought ;)
    [code]
    mul bl
    [/code]

    The Intel instruction set has a lot of instructions, and a lot of those instructions have a lot of different forms.
    mul comes in these basic forms:
    [code]
    mul r/m8 Multiplies AL by 8-bits register or memory and stores the
    result in AX

    Example: mul bl, mul [ebp + 4*eax + 0x12], mul [0x25475]

    mul r/m16 Idem, but then for 16 bits (EAX <- AX * r/m16)

    mul r/m32 For 32 bits (EDX:EAX <- EAX * r/m32)
    [/code]



    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
Sign In or Register to comment.