Needing help with my Arm Assembly Embedded Systems Assignment

PROG1360 Assignment 2 – Calling Functions Objectives
  • Use and understand our tools

  • Begin actually writing some code

Major Tasks Demonstration – Building on Labs

This assignment builds on the labs so far, and requires that you now write some code.

The Demonstration section of this document outlines the items you are required to show.

Tasks Changes to the C Code

Modify the xx_hook.c file from your previous labs as follows:

Change the declaration for

int add_test(int x, int y)

to

int xx_led_demo(int count, int delay)

where xx is replaced by your initials (i.e. if your name is John Smith, it would be js_led_demo).

Change the name of the C function that you add to the menu to xxA2, where xx corresponds to your initials (i.e. if your name is John Smith, it would be jsA2). Make sure you change the corresponding ADD_CMD macro at the bottom of the file.

Modify the xxA2 function to retrieve two arguments from the user as shown in your lab – count (uint32_t) and delay (uint32_t). Provide sensible defaults if the user does not provide one or both parameters.

Change the user interface text to reflect the fact that we are now doing something other than adding numbers together.

Changes to the Assembly Code

Modify the xx_asm.s code from your previous lab as follows:

Change the name of the function add_test to xx_led_demo, corresponding to the change you made in the C file. Be sure it has been changed everywhere it needed to be changed.

Remove the old contents of add_test, replacing it with new code that does the following:

  1. Toggles all 8 LEDs using a loop. To make your life easier, they do not need to be in order.

  2. Delays between LEDs toggling according to the delay passed by the user.

  3. Repeats this cycle the number of times specified by the user.

Demonstration

Please note that you must be prepared before offering to demonstrate your code. You must demonstrate the code that you have submitted to the eConestoga dropbox.

For this assignment, you will demonstrate the following items. You may use a lab PC or your own. If needed, you may use a classmate’s VM, but you MUST run your own code and only your own code. You must demonstrate in your regularly scheduled lab period. If you demonstrate modified code, you will receive a late penalty according to how long it has been since the dropbox deadline.

Requirements
  1. Your xx_hook.c and xx_asm.s code as taken directly from the drop box compiles.

  2. Your code deploys with sudo make program.

  3. Your code runs with no parameters provided (sensible defaults).

  4. Your code runs with only a count provided (and that count is used correctly).

  5. Your code runs with both a count and a delay value provided (and those values are used correctly).

Code

Your code will be evaluated as follows. Each will be evaluated on a 0 to 5 basis, where 0 is unacceptable or not present, and 5 is excellent.

Functionality

Your program behaves as specified.

Proper use of Registers, the stack, and link register

Only necessary items (no more, no less) are pushed onto the stack. Your function calls use the link register appropriately.

Code Readability

Your code is properly indented, does not wrap or have long lines, and can be logically understood.

Code comments

As this is assembly language, you must extensively comment any code that is unclear (i.e. nearly every line).

Document Requirements

Your document will include:

  1. Your complete xx_hook.c file contents.

  2. Your complete xx_led_test function, including the function header documentation. See the function busy_delay in the most recent lab for the required format.

Please use a monospace font (such as Consolas) and ensure that all indenting and margins are appropriate. You may use landscape if required.

This document does not require a cover page, but you may wish to include one. Please read and follow the remaining requirements below. Failure to meet requirements will result in a 20% penalty per broken requirement.

  • It must be typewritten

  • Your name and student number must be clearly included at the top of every page

  • You will include the following marking table at the end

Item

Grade

Demonstration (Readiness and Success)

/ 5

Code

Functionality

/ 5

Proper use of registers, etc.

/ 5

Readability

/ 5

Comments

/ 5

Code Subtotal

/ 20

Total

/ 25

Submission Guidelines

Please read and understand the submission guidelines below. Failure to correctly submit any required component will result in 10% penalty per missing or incorrect component.

Paper Submission

Please submit a single document, with the evaluation table included on the last page. Be sure that all pages are properly stapled together. Printed source code should be included as specified.

Do not submit this assignment specification as a part of your document.

Electronic Submission

Exactly TWO items will be submitted electronically.

  • Upload the complete document as a SINGLE document in PDF format.

  • Upload your complete assembly file (the xx_asm.s file). For this assignment, please do not compress this file, and please be certain you have named it correctly.

Complete file naming and upload guidelines are provided below.

Electronic Submission and File Naming

Often, multiple groups will name their assignment files assignment1.zip (or some other common combination) which results in confusion and complications when downloading and unzipping submitted electronic files.

Please follow the following guidelines for all submissions this term. Failure to follow the electronic submission guidelines may result in a 20% penalty per infraction.

As long as other file naming conventions are followed, you may choose to append an assignment identifier (i.e. “_a1” or something else as appropriate) as the last element before the file extension.

Document Naming and Submission

Unless otherwise requested, you should only ever submit a single document containing the complete document as specified. This document must be:

  • A professionally formatted document adhering to the SET report standard

  • A single PDF file, not included in a zip

Unless indicated otherwise, do not submit the assignment specification as a part of your document.

Documents should be named with the usernames of all team members as follows:

  • Individual assignments: username.pdf (i.e. jsmith.pdf)

  • When working alone: username_alone.pdf (i.e. jsmith_alone.pdf)

  • When working with a partner: username1_username2.pdf (i.e. jsmith_bjones.pdf)

  • When working as a team: username_team.pdf (i.e. jsmith_team.pdf – but be certain to include all team members on report title page)