Due: Wednesday, April 8th, 2020 at 11:59pm CDT
Submit: Turn in your two source files using the
turnin command
on a
Systems Lab machine. Please name your files "main-heap.S" and "main-divide.S". Failure to follow this simple convention will cause TA-Bot
to fail.
Remember, your final turnin command (to submit your final changes) will look like this:
turnin -c cosc2200 main-heap.S main-divide.S
Work may be completed in teams of two. The names of both partners
must appear in a comment block at the top of your file for credit to
be given. I
strongly recommend that you take the time to meet
with your partner in person and work together on these projects,
rather than work separately and try to integrate at the last minute.
Use the command hook "
TA-BOT:MAILTO" in a comment in your
source files to designate mail addresses for TA-Bot output. An example
of this hook is included for you at line 1 of the "main.S" template (in pi3Playground).
This UNIX tutorial may be of some
assistance.
- Login to a lab machine, and change to a fresh working directory for Homework 7.
- Execute the the following command to get a new playground:
   tar xvzf ~pmcgee6/cosc2200/pi3Playground.tgz
Q1 - Heap Limits
Write an ARM Assembly language program that requests dynamic allocation of memory from the operating system (malloc function) until the operating system will not allocate any more. Submit your written answers as comment blocks at the top of your main-heap.S file (this file is not graded by TA-bot).
Analysis Questions:
- How much memory will the ARM Playground give you?
- How does this amount compare to the physical memory on the Raspberry Pi 3?
- Experiment with different request sizes. What do you see?
- What is the lowest address returned by malloc? What is the highest?
Q2 - Divide
Write an ARM Assembly program that performs integer division. The ARM playground already provides a divide() function -- you may not call this function. Call your function mydivide(), and ensure that it is a proper replacement for the builtin divide() for all sensible, positive, integer inputs. Your program should continue to ask for unput until EOF is entered.
Your mydivide() should take a dividend and divisor as its two arguments in r0 and r1, and return the integer quotient and remainder in r0 and r1.
Example:
? 100
? 40
2R20
? 10
? 5
2R0
? 6
? 6
1R0
? 90
? 9
10R0
? 88
? 5
17R3
?
All user process have completed.
Note: Ctrl+D is the final input in the example.