Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Various assembly programs for ARM processors

Notifications You must be signed in to change notification settings

jreiser1/cs2400-arm-asm-negate-exercise

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ARM Assembly Negate Exercise

MSUD, CS 2400, Spring 2019

Requirements

Preliminaries

  1. Download and install VisUAL.
  2. Find out what UAL means in the context of ARM syntax.
  3. Review the instructions supported by VisUAL.

Quick negate

  1. Load the short negate program into VisUAL (Use Open from the menu).
  2. Execute the program. View the memory. (Use Tools from the menu.)
  3. QUESTION: What does the program do?
  4. Single-step the program and watch the registers, memory locations, and status flags change.

Long negate

  1. Load the long negate program into VisUAL (Use Open from the menu).

  2. Execute the program. View the memory. (Use Tools from the menu.)

  3. Answer the following questions:

    1. QUESTION 1: What is the short program doing that the long program is not?

    The short program loops through the words array in a more efficient manner, while the long program stores most or all of the array seperately in registers

    1. QUESTION 2: Why do you think the compiler has generated such assembly code?

    Because the computer has to track stack and pointer information for everything involved in the for loop, as well as calls/branches to the negate function.

    1. QUESTION 3: How would you try to change the code so that the compiler would generate an assembly program that behaves more like the short one above? The original code is in negate.c. Modify it and see if that changes the generated code. (The code is generated in the Compiler Explorer. Use the ARM gcc 8.2 compiler. Use the following compiler options: -fomit-frame-pointer -mcpu=cortex-m3 -mtune=cortex-m3. Note: The assembly generated by the Compiler Explorer cannot be run directly in VisUAL. You might want to check the differences between the original generated code and the long negate program to see what modifications you have make.)

    I would remove the loop and add individual calls to the negate function, or manually execute the negate instructions on each of the numbers we are using. This would eliminate the need for tracking pointers and stack information for the loop that is present in the longer program

  4. Single-step the program and watch the registers, memory locations, and status flags change.

  5. Modify the long program to do what the short one is doing.

Submission

  1. Fork this repository.
  2. Clone and develop.
  3. Commit your changes and push to the remote.
  4. Submit your fork's URL on the Google Classroom assignment CS 2400 - Classwork - ARM assembly negate exercise.

About

Various assembly programs for ARM processors

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Assembly 87.7%
  • C 12.3%