[SOLVED] COMP2660 Assignment1-an ASM program

30.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

Rate this product

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

EDX = (A + B) – (C + D)

Declare and initialize the memory variables A, B, C, and D to 32-bit signed integer values -10, +210, -3456, +43210, respectively. Register EDX contains the result.

  1. Display the string “EDX = (A + B) – (C + D)” alone in a single line.
  2. Display the values of all the variables together in the next line; each separated by 3 spaces and a dash and 3 spaces again.
  3. Display an empty line
  4. Display the result EDX, in binary, then in decimal, and then in hexadecimal; each in a separate line.

Question  #2 (10 points)

Write an ASM program that uses the variable below and MOV instructions to copy the value from bigEndian to littleEndian, reversing the order of the bytes. The number’s 32bit value is understood to be 12345678h.

.data bigEndian  BYTE 12h, 34h, 56h, 78h littleEndian DWORD ?

Display the values of bigEndian and littleEndian.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.