Comp 3350 HW # 6:  Theme: Arithmetic and Procedures solution

$25.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (3 votes)

 

  1. [Arithmetic Expression] Write a program that computes the following arithmetic expression:

EAX = -Val3 + Val1 – (Val2 + Val4)

 

Use the following data definitions:

Val1 SWORD -8

Val2 SWORD  -21

Val3 SWORD   36

Val4 SWORD   93

 

  1. [Arrays] Write a program that:

 

  • Prompts the user for integer input a dozen times
  • Stores these inputs in an array
  • Displays the stored array values on the screen using WriteInt (not DumpRegs).

 

In your submission, please embed the full program (.lst file) and one screen shot with at least one positive and one negative input value.

 

Use the following:

 

.data

Prompt1  BYTE “Please input a value:”, 0

Autumn   WORD 12 DUP(?)

 

 

  1. [Compares, Procedures] Write a procedure, MinArray that computes the minimum value stored in the array Autumn.   Write a main program that calls MinArray and prints the minimum value found.

 

Use the following:

.data

prompt      BYTE “Please input a value: “, 0

spacing     BYTE “, “,0;

result      BYTE “The minimum of value inputs is: “,0

Autumn      WORD 12 DUP(?)

 

In your submission, please embed the full program (.lst file) and one screen shot showing the minimum value found.

 

  1. [Flags]  Write a program which has the following parts:
    1. Use the Add and Sub instructions to set and clear the CF flag
    2. Use the Add and Sub instructions to set and clear the OF flag
    3. Use the Add and Sub instructions to set and clear the ZF flag
    4. Use the Add and Sub instructions to set and clear the SF flag

Submit the list file as well as appropriate trace of the runs.