In x86 assembly language, the addition and multiplication operations are as follows:
ADD [operand1], [operand2] where operand 1 can be a register, operand 2 can be a register, constant or memory address Requires 1 to 7 hours depending on the processor model and type of operand2
MUL [operand]; for unsigned multiplication, multiplies the contents of the battery register (AL, AX, EAX) by the operand, which can be a register or a memory address. And again, depending on the type of operand and processor model, it takes 12-38 hours. There is also a MUL version that has signed multiplication.
This is the main assembly language without modern SIMD extensions such as SSE, etc. Actual speed, as mentioned above, depends on compiler optimization.
A smart compiler will most likely replace your 123456 + 123456 + 123456 with 3 * 123456
source share