you have the following algorithm for calculating the real addres (and maybe it works only in P-mode ?? )
address = offset + [data at base address] + value of index register * multiplier (+base of the segment :).
multiplier can be 1,2,4 or 8 (there are two bits in the instruction opcode reserved for it)
your example
dword ptr array[eax * 4]
doesn't have a base addres - you have just indexed array
calculated address = offset + value of index register * multiplier
Main Topics
Browse All Topics





by: heyhey_Posted on 1998-11-17 at 22:36:54ID: 1178136
mov dword ptr array[eax * 4], 0 is a standard 486 instruction using some of the more special types of addressing
you can look at some Assembler book for more details
(sorry if i'm wrong with terms - i'm just translating a Russian book)
mov eax, 123456h - immediate addressing
mov eax, ecx - registry addressing
mov eax, [123456h] - absolute addressing
mov eax, [ecx] + 123456h - indexed addressing with offset
mov eax, [esi*4] + 1234h - indexed addressing with scaling and offset
..
mov eax, [ebx][edi*2] + 12345h - base index with scaling and offset addressing
so you have ' indexed addressing with scaling and offset'. this is a standard addressing mode in 386+ (or 486+) processors.
hope this helps
heyhey