Multiplying Numbers Using Pointers
Explore how to multiply numbers using pointers on Linux ARM64 by examining the C/C++ code, ARM64 assembly instructions, and GDB disassembly output. Understand pointer dereferencing versus multiplication and trace register and memory changes through step-by-step debugging.
Pointers to multiply numbers
The pseudocode statement for multiplication is as follows:
[x1] <- [x1] * [x0]
This statement means that we multiply the contents of the memory cell whose address is stored in the x1 register by the value stored in the memory cell whose address is in the x0 register.
In the C/C++ language
In C or C++, we write a similar expression as that for the addition operation
Note: We have two distinct meanings of ...