html5-img
1 / 8

IA32 addressing modes

IA32 addressing modes. Immediate Direct memory Register Register indirect Indexed Based-indexed. addressing. Opcode indicates what operation is to be performed. Operands specify the location of data. Example of addressing modes that we have already used: A = 12 B dword 52

abie
Télécharger la présentation

IA32 addressing modes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IA32 addressing modes • Immediate • Direct memory • Register • Register indirect • Indexed • Based-indexed

  2. addressing • Opcode indicates what operation is to be performed. • Operands specify the location of data. • Example of addressing modes that we have already used: A = 12 B dword 52 mov eax, 1 ; immediate mov ebx, eax ; register mov ecx, A ; immediate mov edx, B ; direct memory

  3. Register indirect • Say B is located at memory location (address) 400. We load the address of B into a register. movebx, 400 ;load the address of B moveax, ebx ;eax is now 400 moveax, [ebx] ;eax now equals 52 • This is the register indirect addressing mode. The register does not contain the value but contains a reference to (pointer to/location of) the value in memory.

  4. Indexed Used to: • reference memory at a constant offset from a register • when register points to object and data member is a know offset from start of object • reference memory using a register as an additional offset • when register is used as an offset to an array element

  5. Indexed A dword 592h, 50h, 60h, 70h, 80h, 90h mov eax, 4 mov ebx, A[eax] ;what’s in ebx? mov ecx, [A+eax] ;what’s in ecx?

  6. Indexed A dword 592h, 50h, 60h, 70h, 80h, 90h moveax, 4 movebx, A[eax] ;what’s in ebx? movecx, [A+eax] ;what’s in ecx?

  7. Based-indexed

  8. Make a sum

More Related