I am learning assembly for x86 using DosBox emulator. I am trying to perform multiplication. I do not get how it works. When I write the following code:
mov al, 3
mul 2
I get an error. Although, in the reference I am using, it says in multiplication, it assumes AX is always the place holder, therefore, if I write:
mul, 2
It multiplies al
value by 2. But it does not work with me.
When I try the following:
mov al, 3
mul al,2
int 3
I get result 9 in ax. See this picture for clarification:
Another question: Can I multiply using memory location directly? Example:
mov si,100
mul [si],5
There's no form of
MUL
that accepts an immediate operand.Either do:
or (requires 186 for imul-immediate):
or:
or: