From the course: Learning Assembly Language

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Indirect addressing and pointers

Indirect addressing and pointers - Python Tutorial

From the course: Learning Assembly Language

Start my 1-month free trial

Indirect addressing and pointers

- [Instructor] It's useful sometimes to be able to reference memory using a register which holds the memory address rather than directly referencing memory in the instruction. This is known as indirect addressing. I've prepared a demonstration for this and also have this ready in the debugger. In the data section, we setup a set of data locations and an index. In the code section of line 20, we move var1 into rax. This is know as a direct load. We then load the address of var1 into ecx, which we can do with the offset qualifier. And then load the value pointed to by ecx into ebx. This is known as an indirect load which we do using square brackets to show ecx as a pointer. We've used the term offset here but equally could have used the term address, addr. They're exactly the same. Let's see this in action. We step through the first instruction and see 1F loaded into rax as we expect. The next step puts the value…

Contents