|
It is strange that the new code (which is omitting the index parameter) does also work on the Rev.B chip, so it appears to be backwards compatible. I asked Atmel about this but they are not getting back to me. How is this possible? According to "Procedure Call Standard for the ARM Architecture" document, when calling a subroutine using C, the parameters are passed left to right, and through registers r0 - r4 (up to 4). So I suppose in the Rev.B ROM code, "index" was expected to be in r0, and "command" was expected to be in r1. In Rev.C ROM code, "index" is omitted, so "command" is expected to be in r0. It makes sense that I need to make the code change above to get it to work in Rev.C, but how in the world does it work on the Rev.B chip, if it expects the "command" in r1 but it is actually passed in r0? Am I missing something here? I know I should be happy that it works, but I would like to understand why, and make sure there are no problems down the road...
|