Adding Numbers Using Pointers
Learn how to add numbers using pointers in GDB disassembly.
We'll cover the following...
Pointers to add numbers
Now, we’ll look at the next pseudocode statement:
[x1] <- [x1] + [x0]
Recall that [x0]
and [x1]
are the contents of memory cells whose addresses (locations) are stored in x0
and x1
CPU registers.
We look at how we add numbers by using pointers in the following languages:
In the C/C++ language
The expression [x1] <- [x1] + [x0]
is equivalent to the following C/C++ language expression:
*pb = *pb + *pa;
In this expression, the *
operator is an instruction to retrieve memory contents pointed to by the pointers pa
or pb
(also called pointer ...