diff --git a/examples/rtic_bare2.rs b/examples/rtic_bare2.rs index d4dc217225a267989d7ab5690de3029358cf091e..0c88115a9e64c04348a745515ade06c978ac87a7 100644 --- a/examples/rtic_bare2.rs +++ b/examples/rtic_bare2.rs @@ -109,7 +109,14 @@ fn wait(i: u32) { // // Dump generated assembly for the "wait" function. // -// ** your answer here ** +// => 0x080004a0 <+0>: push {r7, lr} +// 0x080004a2 <+2>: mov r7, sp +// 0x080004a4 <+4>: movw r0, #16960 ; 0x4240 +// 0x080004a8 <+8>: movt r0, #15 +// 0x080004ac <+12>: nop +// 0x080004ae <+14>: subs r0, #1 +// 0x080004b0 <+16>: bne.n 0x80004ac <rtic_bare2::wait+12> +// 0x080004b2 <+18>: pop {r7, pc} // // Under the ARM calling convention, r0.. is used as arguments. // However in this case, we se that r0 is set by the assembly instructions, @@ -119,7 +126,9 @@ fn wait(i: u32) { // // Answer in your own words, how they assign r0 to 1000000. // -// ** your answer here ** +// movt "loads" the immidiate value to the upper part of the word [31:16]. +// movw "loads" the immidiate value to the lower part of the word [15:0]. +// they are then "or":ed together. // // Commit your answers (bare2_2) //