diff --git a/.cargo/config b/.cargo/config index ec3e4e9f9f4e09c6ef0c1c02ce2667e97db68b91..a55bec77bc66a803a1ead7773e136423a7234ed4 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 e0882f5dc56cb48b410448e713350f6d369aaeb8..238dfe4f12846d7b1d0d2233e218ab5a71fc6294 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) //