Question: Question #1 (10 points) Write an ASM program that evaluates the following expression, using variables: Z = ( A + B )-( C - D

Question #1(10 points)

Write an ASM program that evaluates the following expression, using variables:

Z = (A +B)-(C - D)

  1. Declare and initialize the memory variable Ato 32-bit unsigned integer value 543210 and variableB to 16-bit unsigned integer value 3210.
  2. Declare the memory variables Cand Dand read in their values from the keyboard as 32-bit unsigned integer value 43210 and 8-bit unsigned integer values 210, respectively.
    1. You should display a message asking for the value of the variable, for example: What is the value of C? then
    2. Read in the value of Cfrom the keyboard and then
    3. Display the value you have read beside (ie, to the right of) the message What is the value of C?. Then repeat for variable Din the next line.
  3. VariableZshould be declared as a 32-bit unsigned integer.
  4. Display the string Z = (A +B)-(C - D) alone in a single line.
  5. Display the values of all the variables A, B, C, Dtogether in the next line (in the order in which they appear in the expression); each separated by 3 spaces and a semicolumn and 3 spaces again.
  6. Display an empty line.
  7. Display the final result contained in variable Z, in binary, then in decimal, and then in hexadecimal; each in a separate line.

Question #2(10 points)

Write an ASM program that the variables below and MOV instructions to copy the value from bigEndianto littleEndian, reversing the order of the bytes. The numbers 32-bit value is understood to be 89ABCDEF hexadecimal.

.data

bigEndian BYTE 89Bh, ABh, CDh, EFh

littleEndian DWORD ?

Display the values of littleEndianand bigEndianin separate lines.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!