header

Week 14 Homework

Due Wednesday, Apr 24

Problem 1

Modify Example 1 on the Intel Assembly Language page to minimize the number of memory accesses. Remember that registers AX, BX, CX, and DX can all be used as general purpose registers.

Problem 2

Write a machine language program to implement the following Java-like instruction:

y = ax + b;

where all identifiers refer to signed 16-bit integers and a = 3, b = 5, and x = 10. For this problem, use immediate addressing for the known values (3, 5, and 10) and direct addressing for the variable y. The only variable you should declare is y (which should be initialized to zero).

Problem 3

Modify your program to use four variables: a, b, x, and y and direct addressing. Initialize the values of a, b, and x as specified above and initialize y at zero.

Send me your assembly language files H14P1.asm, H14P2.asm and H14P3.asm as email attachments.