Adding Numbers Using Pointers

Learn how to add numbers using pointers in GDB disassembly.

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 ...

Access this course and 1400+ top-rated courses and projects.