CST 121 Projects

Using 8086 Assembly-Language,
write separate programs to perform
each of the following tasks.

  1. Desk-calculator: Enter two numbers; compute and display the sum, difference, product, and quotient ( + - * / ).

  2. Fibonacci: Display the Fibbonacci series, up to 200.
    1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... (Each # is the sum of the previous two.)

  3. Sum between two numbers: Enter two integers; compute and display the sum of all integers between them (inclusive); (i.e. if the first number is 20 and the second is 22, then the sum is 63)

  4. Fac7: Compute the factorial for each number, when the user enters any numbers up to 7. Exit when a zero (or negative) is entered. (No need to test for illegal inputs.)

  5. Fac12: Modify your factorial program to accept numbers up to twelve.
    For illegal inputs (such as 13 or -2), display an error message but continue.

  6. PROJECT6: Modify the PROJECT6.ASM file to perform all of the computations described in the midterm exam.

Computations to be performed by procs defined in "PROJECT6.ASM"

Write your code for these function in the file "PROJECT6.ASM" and use "calc.asm" to call and test your code. NOTE: Arguments "A" and "B" are in registers AX and BX. Do not use memory for "A" and "B". (All values are integers.)
Result is returned in register AX.
  1. CalcA: Return whichever value is greater.

  2. CalcB: Compute the mean average of the two values.

  3. Skip the letter "C" in this set of procs.

  4. CalcD: Compute A 3 (A cubed = A * A * A).

  5. CalcE: Compute A B (A raised to the B power).
    Use a loop to multiply A by itself, B times.

  6. CalcF: Compute the sum of all integers from A to B, inclusive. (For example, the sum from 10 to 14 is 60, the sum from 2 to 100 is 5049)

  7. CalcG: Swap the high and low bytes of each value, and return whichever value is greater.

  8. CalcH: Swap the high bytes of each value, and return whichever value is greater.

  9. CalcI: Return the value 100 if any of the four bytes is identical to the ASCII value of one of your initials (in UPPER case); otherwise return zero.

  10. CalcJ: Return the value 100 if any of the four bytes is identical to the ASCII value of one of your initials (regardless of case); otherwise return zero.

  11. CalcK: If any two bytes of the four bytes are identical, then return its value; otherwise return zero.

  12. CalcL: Add the complement of A to the value of B.

  13. CalcM: Compute the number of times that the smaller value can be subtracted from the larger value.