Способы адресации.
Способ 1: Прямая адресация
movw 0x402008, %ax
movw M, %ax
//----------------------------------
Способ 2: Косвенная адресация
Базовое смещение
leaq data, %rbx
//Скопировать в регистр %ax значение из памяти по
//тому адресу, который содержится в %rbx
movw 8(%rbx), %ax
//--------------------------------------
Способ 3: Косвенная адресация
Текущее смещение
leaq data, %rbx
movq $8, %rcx
movw 0(%rbx, %rcx), %ax
//-------------------------------------
Способ 4: Косвенная адресация
Базовое смещение + Текущее смещение
leaq data, %rbx
movq $2, %rcx
movw 4(%rbx, %rcx, 2), %ax
// Итоговый адрес: %rbx + 4 + %rcx*2
// 402000 + 4 + 2*2 = 402008
Ещё видео!