| | |
80x86 Word Memory Access
![]() |
80X86 Speeding up word memory access.
When the address of the first byte of a word lies
at an odd address the processor must make two memory
fetches for each byte of the word.
But if the address of the first byte of the word lies
at an even address the processor can pull in both bytes
of the word in one memory fetch.
If the first word of an array of words lies at an even
address so will every other word in the array.
1st Word__2nd Word__3rd Word
|0100|0101|0102|0103|0104|0105
^________^________^_______
This speeds up performance when accessing an array
of words.
Assemblers usually provide an ALIGN directive to align
a word at an even address.
I was looking through the i386 arch manual on this, and
it mentioned that there could be a slight increase in speed
when the target address of control transfer instructions
were evenly divisible by four, does this apply to the 8086/real-mode?
Good day.
When the address of the first byte of a word lies
at an odd address the processor must make two memory
fetches for each byte of the word.
But if the address of the first byte of the word lies
at an even address the processor can pull in both bytes
of the word in one memory fetch.
If the first word of an array of words lies at an even
address so will every other word in the array.
1st Word__2nd Word__3rd Word
|0100|0101|0102|0103|0104|0105
^________^________^_______
This speeds up performance when accessing an array
of words.
Assemblers usually provide an ALIGN directive to align
a word at an even address.
I was looking through the i386 arch manual on this, and
it mentioned that there could be a slight increase in speed
when the target address of control transfer instructions
were evenly divisible by four, does this apply to the 8086/real-mode?
Good day.
----------------------------------------------------------
To control a mind violates a man, and all it has been used for is
hurting and afflicting. Nowonder I progam in assembly...
--->Now available http://dotcoding.netai.net/
To control a mind violates a man, and all it has been used for is
hurting and afflicting. Nowonder I progam in assembly...
--->Now available http://dotcoding.netai.net/
0
#3 33 Days Ago
Yes, DWORD alignment is always preferred. But check with the standard literature on optimization:
http://www.agner.org/optimize/
http://www.agner.org/optimize/
while (CPU is present) {some assembly required}
![]() |
Similar Threads
- STL map and pair causing memory access error (C++)
- Arithmetic Overflow - MIPS (Assembly)
- Memory Access Violation (C++)
- Please tell me about Direct Memory Access (Motherboards, CPUs and RAM)
- Delphi Class memory access violation. Why??? (Pascal and Delphi)
- Memory access violations (C)
- How to automate some interaction between "Word" and "Access" documents? (Visual Basic 4 / 5 / 6)
- Direct Memory Access (Python)
- Unable to access hotmail since upgrading to 98 se (Windows 95 / 98 / Me)
Other Threads in the Assembly Forum
- Previous Thread: code for fan timer
- Next Thread: Counting 1's in 16 bit word
| Thread Tools | Search this Thread |





