Question: Learn how to declare and define memory data and transferring data from memory to registers, and learn a program layout at the assembler level by

Learn how to declare and define memory data and transferring data from memory to registers, and learn a program layout at the assembler level by looking at the structure and contents of a listing file.

Requirements:

A. (8 points) Implement the following expression in assembly language:

AX = val2 + 9 + val3 - val1 Assume that val1, val2, and val3 are 16-bit integer memory variables.

Besides, val2 and val3 are unsigned integer while val1 is signed integer.

Assign val2 = 11, val3 = 16, val1 = 6.

Use the debugger to verify the result in AX. Report AX value in decimal as part of the Comment header:

B. (7 points) Write a program that contains four instructions:

- add the number 10 to the EAX register,

- add 8 to the EDX register,

- add 3 to ax register,

- add 2 to al register.

Build the program and make sure it has no error. Run the program and make sure it works. Generate a listing file and examine the machine code generated by the assembler.

- What differences, if any, did you find between the instructions formats?

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!