diff --git a/examples/bare1.rs b/examples/bare1.rs index deaf9002e8e4601b6daf4f461a3642cedd934c2f..cdcbff49bd8c28c5eaf5a766b27710e959c85d33 100644 --- a/examples/bare1.rs +++ b/examples/bare1.rs @@ -79,16 +79,28 @@ fn main() -> ! { // > disassemble // // ** your answer here ** -// +// Dump of assembler code for function bare1::__cortex_m_rt_main: +// 0x0800040a <+0>: sub sp, #8 +// 0x0800040c <+2>: mvn.w r0, #1 +// 0x08000410 <+6>: str r0, [sp, #4] +// => 0x08000412 <+8>: bkpt 0x0000 +// 0x08000414 <+10>: mov.w r0, #4294967295 ; 0xffffffff +// 0x08000418 <+14>: add r4, sp, #4 +// 0x0800041a <+16>: str r0, [sp, #4] +// 0x0800041c <+18>: bkpt 0x0000 +// 0x0800041e <+20>: mov r0, r4 +// 0x08000420 <+22>: bl 0x8000400 <core::ptr::read_volatile> +// 0x08000424 <+26>: bkpt 0x0000 + // How many instructions are in between the two `bkpt` instructions in the loop. // Notice, the generated code may not be exactly what you expect :) // // ** your answer here ** -// +// there are 6 instructions // Which instruction stores the local variable on the stack. // // ** your answer here ** -// +// str r0 [sp, #4] // Commit your answers (bare1_2) // // 3. Release mode (optimized builds).