Suppose W1 and W2are double word variables Indicate whether

Suppose W1 and W2are double word variables. Indicate whether each of the following is legal or illegal. If it is illegal, give reason why. MOV BX.W1 INC W2 SUB BL, 256 ADD Wl, W2 XCHG W2, ECX Translate the following assignment statement into assembly instructions. Assume that the variables are word variables. Use only MOV, ADD, SUB, INC, DEC and NEC operations. A = B - A + C * 2-(D - 1)

Solution

1

2)

SUB A,B, A --> Subtracts the value of A from B and the result is stored in A.

MUL Y,C , 2 ---> Multiplies the value in C with 2 and the result is stored in Y

SUB Z, D, 1 ---> Subtracts the value in D by 1 and the result is stored in Z.

ADD A, A, Y ---> The value in Y is added to A and the value is stored in A.

SUB A, A, Z ---> The value in Z is subtracted from A and the result is stored in A. This A contining is the Final Value.

 Suppose W1 and W2are double word variables. Indicate whether each of the following is legal or illegal. If it is illegal, give reason why. MOV BX.W1 INC W2 SUB

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site