Multiplication is weird because it only accepts one operand:
mul <src> (unsigned)
imul <src> (signed)
This operand will then be multiplied by rax (or any lower-bit version), with the result being stores in the two special registers:
rax (or any lower-bit version) will store the first half of the answer
rdx (or any lower-bit version) will store the second half of the answer (if applicable)
This is because multiplying two values together may exceed the limit of that data size, thus two registers are sometimes needed to store it.
Examples
Caution: The following examples are unchecked and may be incorrect. Verify important info.
Byte Multiplication
al => Number you are multiplying and lower 8 bits of result
ah => Upper 8 bits of result
byte = byte * byte
mov al, 10
mov bl, 9 ; bl can be any register
mul bl ; this is the multiplication
; result lies in `al` and `ah`
; if you know my result does not overflow the 0-255 limit then you can ignore ah
; to save your value:
mov byte[answer], alword = Byte x Byte
mov al, byte[x]
mul byte[y]
; first way to handle result:
mov byte[answer], al
mov byte[answer+1], ah
; (works because two bytes make up 1 word)
; second way to handle result:
mov word[answer], axWord Multiplication
ax => Number you are multiplying and lower 16 bits of result
dx => Upper 16 bits of result
word = word * word
mov ax, word[x]
mul word[y]
mov word[answer], axdword = word * word
mov r10, rdx ; preserving, unneeded i think
mov ax, word[x]
mul word[y]
mov word[answer], ax
mov word[answer+2], dx
mov rdx, r10 ; preserving, unneeded i thinkword = word * byte
Need to extend the smallest size to the biggest available size in the equation
mov ax, word[x]
movzx cx, byte[y] ; extending
mul cx
mov word[answer], axdword = word * byte
movzx eax, word[x]
movzx ecx, byte[y]
mul ecx
mov dword[answer], eax ; will result 32 bit resultDword Multiplication
eax => Number you are multiplying and lower 32 bits of result
edx => Upper 32 bits of result
dword = dword * dword
mov eax, dword[x]
mul dword[y]
mov dword[answer], eaxqword = dword * dword
mov eax, dword[x]
mul dword[y]
mov dword[answer], eax
mov dword[answer+4], edx
; or
mov rax, dword[x]
mov r11, dword[y]
mul r11
mov qword[answer], raxQword Multiplication
rax => Number you are multiplying and lower 64 bits of result
rdx => Upper 64 bits of result
qword = qword * qword
mov rax, qword[x]
mul qword[y]
mov qword[answer], raxdqword = qword * qword (rare)
mov rax, qword[x]
mul qword[y]
mov qword[answer], rax
mov qword[answer+8], rdxqword = dword * byte
movsxd rax, dword[x]
movsx r11, byte[y]
imul r11
mov qword[answer], raxqword = qword * byte
mov rax, qword[x]
movzx r11, byte[y]
mul r11
mov qword[answer], raxqword = word * word
movzx rax, word[x]
movzx rcx, word[y]
mul rcx
mov qword[answer], raxqword = qword * word
mov rax, qword[x]
movzx rcx, word[y]
mul rcx
mov qword[answer], rax