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
as per HomeworkLib policy i have answered the 1 st question
Need help on Assembly language 1.Solve the following conditions: A. Suppose AL contains 11001011 and CF...
Q#1 AX contains a numberbetween 0-15. Write code to complement the corresponding bit in BX.For example if AX contains 6; complement the 6th bit of BX. (Note:First bitin BX is at 0th position and last bit is at 15thposition)Marks10Q#2 Suppose that AX=0x3412, BX=0x7856, CX= 0x1CAB, and SP=0x100.Given the contents of AX, BX, CX, and SP after executing thefollowing instructions:PUSH AXPUSH BXXCHG AX, CXPOP CXPUSH AXPOP BX
37. What is the binary value of AL after the following instructions have mov al,01101011b stc rcl al,2 38. What is the binary value of AX after the following instructions have executed? mov ax, 0000000010011101b mov bx, 1010101010000000b shld ax, bx,1 39. What is the binary value of AX after the following instructions have executed? mov ax, 0000000010011101b mov bx, 1010101010001011b shrd ax, bx, 2 will be the hexadecimal values of DX and AX after the following instructions have executed?...
1. Registry conditions: A. Show how the decimal integer * -120 would be stored in 16 bits * -120 would be stored in 8 bits * -32456 would be stored in 32 bits * -32456 would be stored in 16 bits B. For each of the following decimal numbers, tell whether it could be stored (1) as a 16-bit number (2) as an 8-bit number. * 32768 * -40000 *...
Answer based on microprocessor 8086 (10) LEA BX, CX 7. Suppose that (AX)-4AOBH, the content of [1020H] storage unit is 260FH. Try to determine the results of the following instructions. (1) MOV AX, 1020H (AX) (2) XCHG AX, [1020H) ; (AX) (3) MOV AX, [1020H) ;(AX)=- (4) LEA AX, [1020H) ; (AX) 10. Suppose the size of the stack segment is 256 bytes. The starting address of the stack is 1250: 0000H, assuming there are 5 word-sized data in the...
please provide screenshots using dos debug. 4. Assemble the following instruction sequence into the memory starting at address CS: 100 and then verify their machine code in the memory. a. ADD AX, 00FFH b. ADC SI, AX c. INC BYTE PTR [0100H] d. SUB DL, BL e. SBB DL, [0200H] f. DEC BYTE PTR [DI+BX] g. NEG BYTE PTR [DIJ+0010H h. MUL DX i. IMUL WORD PTR [BX+SI] j. DIV WORD PTR [SI]+0030H k. IDIV WORD PTR [BX]ISI]+0030HS. How many...
X86 Assembly Language Help to implement the CipherChar Procedure at the end of the given code INCLUDE Irvine32.inc .data KeyPrompt BYTE "Enter the passphrase: ",0 TextPrompt BYTE "Enter the plaintest: ",0 str1 BYTE "The passphrase has length:",0 str2 BYTE "The plaintest has length:",0 KeyIs BYTE "The passphrase: ",0 PlainTextIs BYTE "The plaintext: ",0 CipherTextIs BYTE "The ciphertext: ",0 KMAX = 64 ; passphrase buffer maximum size BMAX = 128 ; test...
1. What will be the contents of BX after the following instructions execute? mov bx,5 stc mov ax,60h adc bx,ax 2. Describe the output when the following code executes in 64-bit mode: .data dividend_hi QWORD 00000108h dividend_lo QWORD 33300020h divisor QWORD 00000100h .code mov rdx,dividend_hi mov rax,dividend_lo div divisor 3. The following program is supposed to subtract val2 from val1. Find and correct all logic errors (CLC clears the Carry flag): .data val1 QWORD 20403004362047A1h val2 QWORD 055210304A2630B2h result QWORD...
27. For lO computer interface function outb(0xB6, 0x43), which register to hold Ox43? (a) AL (c) DX (d) AX (b) BL 28. Suppose memory variable j is 32-bit. After executing the following instructions int j 0X20AB int *Ptr asmi MOV EAX, Ptr; MOV EBX, [EAX] ADD EBX, 1; Which of the following statements is true? (b) EBX hold 0x20AC in hexadecimal (d) EAX hold 0x20AC in hexadecimal (a) EBX hold 0x20AB in hexadecimal (c) EAX hold Ox20AB in hexadecimal 29....
Assume that the registers have the following values (all in hex) and that CS= 1000, DS = 2000, SS=3000, SI=4000, DI = 5000, BX=6080, BP= 7000, AX=25FF, CX=8791, and DX=1299. Calculate the physical address of the memory where the operand is stored and the contents of the memory locations in each of the addressing examples. a) MOV [SI], AL b) MOV [SI+BX+8], AH c) MOV [BX]+300, DX Now Examine the status of the CF, PF, AF, ZF, and SF if...
LC-3 Programming Help!! The Stack Protocol The following outline is the protocol for passing arguments to a function and returning values. Everything is stored on the runtime stack so that space is used only when the function is executing. As a result the actual address of arguments and locals may change from call to call. However, the layout of the stack frame (activation record) is constant. Thus, the offests from the frame pointer (FP) to the parameters/locals are constant. All...