Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
e7020e_2019
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ridge
e7020e_2019
Commits
6161502e
Commit
6161502e
authored
6 years ago
by
Ridge
Browse files
Options
Downloads
Patches
Plain Diff
bare1_5
parent
5b422065
No related branches found
No related tags found
No related merge requests found
Pipeline
#133
canceled
6 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/bare1.rs
+45
-3
45 additions, 3 deletions
examples/bare1.rs
with
45 additions
and
3 deletions
examples/bare1.rs
+
45
−
3
View file @
6161502e
...
@@ -153,7 +153,42 @@ fn main() -> ! {
...
@@ -153,7 +153,42 @@ fn main() -> ! {
// What is the output of:
// What is the output of:
// (gdb) disassemble
// (gdb) disassemble
//
//
// Dump of assembler code for function main:
// 0x08000404 <+0>: sub sp, #16
// 0x08000406 <+2>: movs r0, #0
// 0x08000408 <+4>: str r0, [sp, #12]
// 0x0800040a <+6>: b.n 0x800040c <main+8>
// 0x0800040c <+8>: ldr r0, [sp, #12]
// 0x0800040e <+10>: adds r1, r0, #1
// 0x08000410 <+12>: mov r2, r1
// 0x08000412 <+14>: cmp r1, r0
// 0x08000414 <+16>: str r2, [sp, #8]
// 0x08000416 <+18>: bvs.n 0x800043a <main+54>
// 0x08000418 <+20>: b.n 0x800041a <main+22>
// 0x0800041a <+22>: ldr r0, [sp, #8]
// 0x0800041c <+24>: str r0, [sp, #12]
// 0x0800041e <+26>: bl 0x8000400 <cortex_m::asm::nop>
// 0x08000422 <+30>: b.n 0x8000424 <main+32>
// => 0x08000424 <+32>: bkpt 0x0000
// 0x08000426 <+34>: b.n 0x8000428 <main+36>
// 0x08000428 <+36>: ldr r0, [sp, #12]
// 0x0800042a <+38>: subs r1, r0, #1
// 0x0800042c <+40>: cmp r0, #1
// 0x0800042e <+42>: str r1, [sp, #4]
// 0x08000430 <+44>: bvs.n 0x8000448 <main+68>
// 0x08000432 <+46>: b.n 0x8000434 <main+48>
// 0x08000434 <+48>: ldr r0, [sp, #4]
// 0x08000436 <+50>: str r0, [sp, #12]
// 0x08000438 <+52>: b.n 0x800040c <main+8>
// 0x0800043a <+54>: movw r0, #2268 ; 0x8dc
// 0x0800043e <+58>: movt r0, #2048 ; 0x800
// 0x08000442 <+62>: bl 0x800046a <panic>
// 0x08000446 <+66>: udf #254 ; 0xfe
// 0x08000448 <+68>: movw r0, #2340 ; 0x924
// 0x0800044c <+72>: movt r0, #2048 ; 0x800
// 0x08000450 <+76>: bl 0x800046a <panic>
// 0x08000454 <+80>: udf #254 ; 0xfe
// End of assembler dump.
//
//
// Commit your answers (bare1_4)
// Commit your answers (bare1_4)
//
//
...
@@ -169,8 +204,15 @@ fn main() -> ! {
...
@@ -169,8 +204,15 @@ fn main() -> ! {
// The optimized version executes assembly commands that the unoptimized does not.
// The optimized version executes assembly commands that the unoptimized does not.
// It also is a lot longer with the length of the commands executed, due to this.
// It also is a lot longer with the length of the commands executed, due to this.
//
//
// Dump of assembler code for function main:
// 0x08000400 <+0>: nop
// 0x08000402 <+2>: bkpt 0x0000
// => 0x08000404 <+4>: b.n 0x8000400 <main>
// End of assembler dump.
//
// As seen on the assemble code from task 2-4 and compared to task 5, the unoptimized
// code is a lot longer and has more instructions than the optimized one.
//
// commit your answers (bare1_5)
// commit your answers (bare1_5)
//
//
// Tips: The optimized build should have 3 instructions
// Tips: The optimized build should have 3 instructions
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment