October 2004
Intermediate to advanced
336 pages
6h 27m
English
This function multiplies two numbers using shift and add operations.
The parameters are passed on the stack. The procedure stores the two parameters in the word registers bx and dx, and accumulates the result in eax, providing 16 bit ¥ 16 bit = 32-bit multiplication. For each bit that is on in dx, it adds the value “bx shifted left the appropriate number of bits” to eax. When it has checked every bit in dx, the correct result will be in eax, which is where the procedure is defined to return it.
The procedure does preserve the passed-in value of registers, and is responsible for popping parameters off the stack. ...
Read now
Unlock full access