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 - Python Tutorial
From the course: Learning Assembly Language
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Setting up a program skeleton4m 27s
-
(Locked)
Understanding registers and memory8m 5s
-
(Locked)
Data types3m 18s
-
(Locked)
Using data structures6m 13s
-
(Locked)
The move and exchange instructions7m 22s
-
(Locked)
Extended move instructions3m 44s
-
(Locked)
Logical or bitwise operators5m 40s
-
(Locked)
Arithmetic operators5m 12s
-
(Locked)
Controlling the assembler flow5m 22s
-
(Locked)
Indirect addressing and pointers4m 50s
-
(Locked)
Console Input and output4m 47s
-
(Locked)
Challenge1m 24s
-
(Locked)
Solution4m 20s
-
-
-
-
-
-