3 ms·
Loved the article as well as the previous HN discussion. Having a bit of trouble understanding #5... I'm not very familiar with (ie: I've never written a line
by BruceEel 12y ago
Loved the article as well as the previous HN discussion.
Having a bit of trouble understanding #5... I'm not very familiar with (ie: I've never written a line of) ARM asm, but with my naive understanding of the code:
06000264: E28FE008 add lr, pc, #8
..I end up with lr pointing to either 06000268 or 06000270 (depending on when the program counter gets incremented), how does the article get to 06000274?
- brigade 12y agoIn the old 3-stage ARM pipeline, the instruction reads pc (as with all registers) during the execute stage, which is 2 cycles after fetch. ARM froze this definition for compatibility, so it's +8 for ARM and +4 for thumb despite not using a 3-stage pipeline anymore.
- BruceEel 12y agoMakes sense now... Thanks!!