3 ms·
Generally, the CPU has instructions for loading memory into registers and storing registers into memory and they specify how much memory to read/write. eg: AR
by ksherlock 4y ago
Generally, the CPU has instructions for loading memory into registers and storing registers into memory and they specify how much memory to read/write.
eg:
ARM (32) has LDR (32-bit), LDRH (16-bit), and LDRB (8-bit)
68K has MOVE.L (32-bit), MOVE.W (16-bit), MOVE.B (8-bit)
There are also some architectures (early Alpha for example) where memory can only be read in aligned 32-bit chunks or aligned 64-bit chunks. If you want to read 8 bits... well the compiler will generate a 32-bit read and then shift/mask the data to get the 8-bits that you care about.
- markus_zhang 4y agoOh you are right, I absolutely forgot the translation part I read about tons of time.