@Rechard3
this is for 32bit platform.
this means that the compiler transforms both types to DWORD.
|
(I guess it's a typo - in above example double are stored in memory as QWORD (8 bytes), instead of DWORD).
Generally speaking: there are a lot of hardware (8-bit 8051, 16-bit 8086, 32bit IA32, etc.). When we're going to write HLL compiler for new hardware we generally have two ways:
1. Make all types the same on all platforms. Problem: let's say our target CPU is 8-bit only, but we want to have 32-bit integer. We need emulate it in software (by joining four 8-bit machine words), which makes things more complicated.
2. Keep types to fit hardware.
So for example, on 8-bit 8051 int has 8-bit, when on IA32 has 32-bit etc.
Advantage: we don't need any software emulation.
Disadvantage: some code cannot be ported from one platform to another directly.
Most compiler makers decide to go into [2] to keep things simply. Hovewer, software emulation is sometimes still in use e.g. to emulate floating point types (float, double in C) on hardware witouth FPU.