Skip to content
Snippets Groups Projects
Commit d2eed697 authored by Hammarkvast's avatar Hammarkvast
Browse files

bare1_2

parent b8c96390
Branches
No related tags found
No related merge requests found
......@@ -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).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment