??? 09/12/07 12:08 Read: times |
#144445 - another architecture shortcoming Responding to: ???'s previous message |
There is another shortcoming in the architecture that makes a '51 less suited for multitasking and that is the way to access the stack.
In order to access some data on the stack you first need to calculate the address, usually by adding an offset to the stack pointer. This requires the accumulator. Then you move the result to r0/1 and finally you can access the data. In short it lacks indexed memory access. This inefficiency is also the reason why most compilers choose to create non-reentrant code by default. So not only the task switching overhead is significant, but also the task itself is slowed down by inefficient stack access. Maarten |