Adding Numbers Using Pointers

Learn how to add numbers using pointers in gdb disassembly.

We'll cover the following...

Pointers to add numbers

The following pseudocode is an instruction to add numbers using pointers:

(rbx) + (rax) -> (rbx)

The pointers (rax)and (rbx) refer to the contents of memory cells whose addresses are stored in %RAX and %RBX CPU registers.

Add numbers in different environments

Now we’ll explore how we add numbers by using pointers in following languages:

Add numbers in C/C++ using pointers

The expression (rbx) + (rax) -> (rbx) is equivalent to the following C/C++ language expression:

*pb = *pb + *pa;
...