lab-02 - CSE 380 Lab #2 Spring 2009 Objective Write three...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 380 Lab #2 Spring 2009 Objective Write three ARM assembly language routines, called avg , min , and max . which return the average, minimum, and maximum of all the digits in a integer entered by the user. The register r0 is used to pass the number to each routine. The result (average, minimum, or maximum) should be returned in r0. The argument passed into the routine will be a positive integer, not exceeding 9,999. For simplicity, the average routine should use integer division when calculating the average (truncating the quotient instead of rounding). For example, if 1,742 is passed in r0, avg returns 3 in r0, min returns 1 in r0, and max returns 7 in r0. Testing The following C program can be used to test your code. The program passes the number ( num ) entered by the user into the avg , min , and max ARM assembly routines, and displays the result on the console. This code is available online on the labs page of the course website. #include <stdio.h>
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 11/03/2011 for the course CSE 380 at SUNY Buffalo.

Page1 / 2

lab-02 - CSE 380 Lab #2 Spring 2009 Objective Write three...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online