From d2eed6978881586c0155d8a13843ee54ed3bf0e6 Mon Sep 17 00:00:00 2001 From: Hammarkvast <tomham-3@student.ltu.se> Date: Thu, 20 Feb 2020 14:32:34 +0100 Subject: [PATCH] bare1_2 --- examples/bare1.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/examples/bare1.rs b/examples/bare1.rs index deaf900..cdcbff4 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). -- GitLab