rust-embedded / embedonomicon

How to bootstrap support for a no_std target
https://docs.rust-embedded.org/embedonomicon/
Apache License 2.0
206 stars 33 forks source link

Address of functions missing in dissassembly #90

Open FuzzyLitchi opened 1 year ago

FuzzyLitchi commented 1 year ago

The affected pages are these two. https://docs.rust-embedded.org/embedonomicon/exceptions.html https://docs.rust-embedded.org/embedonomicon/memory-layout.html

In chapter 2, it says "This is the disassembly of the .text section. We see that the reset handler, named Reset, is located at address 0x8." but that cannot be seen in the disassembly. In chapter 4 there is a similar mistake; the book says "The address of the Reset handler can be seen in the disassembly above, being 0x44." but this can't be seen.

A different oddity is that in Chapter 4 it says that address 0x0000_0045 means "jump to address 0x44". This lines up with what I expect from the explanation. We read the address, the lowest bit is 1, so function is run in "thumb mode" and we consider the actual address to be 0x44 since that is 0x45 with the lowest bit set to 0. But then it says the address 0x83, which is 0b1000_0011, should be understood as 0x84 which is 0b1000_0100. This doesn't make sense to me.