Question: Need help on Assembly language 1.Solve the following conditions: A. Suppose AL contains 11001011 and CF = 1. Give the new contents of AL after
Need help on Assembly language
1.Solve the following conditions:
A. Suppose AL contains 11001011 and CF = 1. Give the new contents of AL after each of the following instructions is executed. Assume the above initial conditions for each part of this question. a. SHL AL,1 b. SHR AL,1 c. ROL AL,2 d. ROR AL,3 e. SAR AL,2 f. RCL AL,1 g. RCR AL,3 B. Suppose EAX contain ABCDH. Show the contents of BX and CX after executing the following instructions PUSH EAX POP BX POP CX C. Suppose that AX = 1234h, BX = 5678h, CX = 9ABCh, and SP = 100h. Give the contents of AX, BX, CX, and SP after executing the following instructions. PUSH AX PUSH BX XCHG AX,CX POP CX PUSH AX POP BX D. Suppose a program contains the lines CALL PROC1 MOV AX,BX and a. the instruction MOV AX,BX is stored at 08FD:0203h, b. PROC1 is a NEAR procedure which begins at 08FD:300h, c. SP = 010Ah. What are the contents of IP and SP just after CALL PROC1 is executed? What word is on top of the stack? E. Suppose SP = 0200h, value at top of stack = 012Ah. What are the contents of IP and SP a. after RET is executed, where RET appears in a NEAR procedure. b. after RET 4 is executed, where RET appears in a NEAR procedure. F. Give the new values of AX and CF/OF for each of the following instructions. a) MUL BL, if AL contains ABh and BL contains 10h b) IMUL BL, if AL contains ABh and BL contains 10h c) MUL AH, if AX contains 01ABh d) IMUL BYTE1, if AL contains 02h and BYTE1 contains FBh G. Give the new values of AX and DX for each of the following instructions, or tell if overflow occurs a) DIV BX, if DX contains 0000h, AX contains 0007h, and BX contains 0002h b) DIV BX, if DX contains 0000h, AX contains FFFEh, and BX contains 0010h c) IDIV BX, if DX contains FFFFh, AX contains FFFCh, and BX contains 0003h d) DIV BX, same values as (c) H. Write assembly code for each of the following high-level language assignment statements. Suppose that A,B, and C are word variables and all products will fit in 16 bits. Use IMUL for multiplication. a) A = 5*A - 7 b) B = (A - B)*(B + 10) c) A = 6 - 9*A d) IF A^2 + B^2 = C^2 where ^ denotes exponentiation THEN set CF ELSE clear CF
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
