From 5aad58aa6f93f6940c59d4163280d83d9f11517f Mon Sep 17 00:00:00 2001 From: "henthe-5@student.ltu.se" <henthe-5@student.ltu.se> Date: Tue, 19 Feb 2019 16:11:15 +0100 Subject: [PATCH] bare1_6 --- .cargo/config | 2 +- examples/bare1.rs | 28 ++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.cargo/config b/.cargo/config index ec3e4e9..a55bec7 100644 --- a/.cargo/config +++ b/.cargo/config @@ -25,7 +25,7 @@ rustflags = [ # "-C", "link-arg=-nostartfiles", # uncomment for unchecked wrapping arithmetics also in dev mode - # "-Z", "force-overflow-checks=off", + "-Z", "force-overflow-checks=off", ] [build] diff --git a/examples/bare1.rs b/examples/bare1.rs index e0882f5..238dfe4 100644 --- a/examples/bare1.rs +++ b/examples/bare1.rs @@ -211,7 +211,13 @@ fn main() -> ! { // Compare the generated assembly for the loop // between the dev (unoptimized) and release (optimized) build. // -// ** your answer here ** +// ** +// Dump of assembler code for function main: +// 0x08000400 <+0>: nop +// => 0x08000402 <+2>: bkpt 0x0000 +// 0x08000404 <+4>: b.n 0x8000400 <main> +// End of assembler dump. +// ** // // commit your answers (bare1_5) // @@ -243,7 +249,25 @@ fn main() -> ! { // // What is now the disassembly of the loop (in debug mode): // -// ** your answer here ** +// ** +// Dump of assembler code for function main: +// 0x08000404 <+0>: sub sp, #8 +// 0x08000406 <+2>: movs r0, #0 +// 0x08000408 <+4>: str r0, [sp, #4] +// 0x0800040a <+6>: b.n 0x800040c <main+8> +// 0x0800040c <+8>: ldr r0, [sp, #4] +// 0x0800040e <+10>: adds r0, #1 +// 0x08000410 <+12>: str r0, [sp, #4] +// 0x08000412 <+14>: bl 0x8000400 <cortex_m::asm::nop::h5c0367e982e73891> +// 0x08000416 <+18>: b.n 0x8000418 <main+20> +// => 0x08000418 <+20>: bkpt 0x0000 +// 0x0800041a <+22>: b.n 0x800041c <main+24> +// 0x0800041c <+24>: ldr r0, [sp, #4] +// 0x0800041e <+26>: subs r0, #1 +// 0x08000420 <+28>: str r0, [sp, #4] +// 0x08000422 <+30>: b.n 0x800040c <main+8> +// End of assembler dump. +// ** // // commit your answers (bare1_6) // -- GitLab