Lab 6: ARM Input Practice -- 2/18/2020

COSC 2200, Spring 2020

Marquette University, Department of Computer Science

Description

In our sixth lab, you and your partner will build a calculator program in ARM, as described below.

Steps

Find your lab partner. Then:

Review: using the divide function

The divide subroutine takes a dividend in r0 and a divisor in r1; upon return, the integer quotient is stored in r0. Disregard the remainder for this lab.

The Program: Simple Calculator Using States

Write an assembler program that uses a set of states to calculate a result. When the program begins, let the current result equal zero. The user enters a number representing the type of operation desired:

These numbers dictate the "states" of your program's execution. You can think of it like a selection menu.
After each operation that is not the ending operation, the current result is printed, and the user again is prompted to input a number to select a new operation.

Example:
? 0
? 5
5
? 1
? 2
3
? 0
? 9
12
? 2
? 6
2
? 4

All user process have completed.