Content deleted Content added
m moved Data Structure Alignment to Data structure alignment: no need for caps |
Wiarthurhu (talk | contribs) caused problems in Windows NT ports, 68000 |
||
Line 1:
{{context}}
A common problem in computer programming is called word alignement.
One way to increase performance, especially in [[RISC]] processors which
are designed to maximize raw performance is to require data to loaded or
stored on a word boundary. So though memory is commonly addressed by
8 bit bytes, loading a 32 bit integer or 64 bit floating point number
would be required to be start at every 64 bits on a 64 bit machine.
The processor could flag a fault if it were asked to load a number
which was not on such a boundary, or call a routine which would effectively
figure out which word or words contained the data and extract the equivalent
value. This caused difficulty when the team from [[Mosaic Software]] ported
their [[Twin Spreadsheet]] to the [[68000]] based Atari. The Intel [[8086]]
architecture had no such restrictions. It would also
cause difficulties in porting Microsoft Office to Windows NT on [[MIPS]]
and [[PowerPC]] for [[NEC]] and [[IBM]]. Since the software was not written with such restrictions
in mind, designers had to set a bit in the O/S to enable non-aligned data.
However since this bit was masked with other flags, it was impossible to
keep the O/S from faulting on non-aligned data, and both platforms ulimately
failed as platforms for hosting Windows applications. This is a classic
instance of programming convenience winning out over careful design for speed, and
one reason for the continued dominance of the x86 architecture over rivals.
== Technical View==
[[Data structure]] members are stored sequentially in a memory so that in the structure below the member Data1 will always precede Data2 and Data2 will always precede Data3:
|