Sie sind auf Seite 1von 1

MT02  ECE2560 Page1 of 1

MT02 ECE2560 Sp 2020
Due date: Sunday April 12, 11:59pm
Collaboration with other students is not allowed

Write the following two subroutines:

Subroutine 1: name ABS

This subroutine returns the absolute value of a signed number
Input: N
Output: Absolute value of N

Subroutine 2: name LIMIT
Input1: N1
Input2: N2
Input3: N
      Subroutine assumes that N1 > N2
Output: M

M = N1 if N >= N1
M = N    if   N > N2 and N < N1
M = N2 if N <= N2

All input, output and local variables should be handled on the stack.

Use the word template and instructions contained on our web site to submit your 
screenshots to Carmen. Do not email directly to your TA or me. Files emailed to the TA 
or me will not be accepted. Include the following in your submission:
i) Pseudo code of the two subroutine
ii) Assembly language source code of the two subroutines

Midterm2 Page 1

Das könnte Ihnen auch gefallen