4 ms·
Accessing a 32 bit word was a simple read op. Accessing an 8 bit byte from a pointer, the compiler would insert assembly code into the generated object code. T
by billpg 4y ago
Accessing a 32 bit word was a simple read op.
Accessing an 8 bit byte from a pointer, the compiler would insert assembly code into the generated object code. The "normal" part of the pointer would be read, loading four characters into a 32 bit register. Two extra bits were squirreled away somewhere in the pointer and these would feed into a shift instruction so the requested byte would appear in the lowest-significant 8 bits of the register. Finally, an AND instruction would clear the top 24 bits.