Hi This is Assembly language, I attack the questions and the book, pls let me know if you can help me. I need unique answers and Not from internet pls and based on the book

1 answer below »
Hi This is Assembly language, I attack the questions and the book, pls let me know if you can help me. I need unique answers and Not from internet pls and based on the book


Microsoft Word - CIS21j_Final_Spring_2018.docx First Name: Last Name: CIS 264 1 Part 1- 20 multiple choice questions (1.5 points each) 1- For any two integers n and m, ((n XOR m) XOR m) produces n. 2- The TEST instruction always alters the destination operand. 3- ANDing an operand with 1 sets the zero flag if the operand was originally an even number. 4- The XOR instruction inverts each bit in a destination operand. 5- The JBE instruction is used when comparing unsigned integers. 6- The OR instruction can be used to find the intersection of two bit-mapped sets. 7- With unsigned operands, the CMP instruction sets the Carry flag when the destination operand is less than the source operand. 8- With signed operands, the CMP instruction makes the Sign flag equal to the Overflow flag when the destination operand is less than the source operand. 9- The MUL instruction sets the Overflow flag if the upper half of the product is not equal to zero. 10- The binary value of AL after the following instructions have executed is 11101101. mov al, 01101011b rol al,2 11- The hexadecimal values of DX and AX after the following instructions have executed are DX=0005 and AX=0000. mov dx,5000h mov ax,20h mul dx 12- The following is a valid LOCAL declaration? LOCAL index:DWORD 13- Local variables are stored on the runtime stack, at a higher address than the stack pointer. First Name: Last Name: CIS 21J 2 14- The following is a valid LOCAL declaration: LOCAL pArray:DWORD PTR 15- The following is a valid LOCAL declaration: LOCAL LastName:BYTE(25) 16- In 32-bit programs, ADDR and OFFSET return the same value. 17- The CALL instruction can only have a single operand. 18- An indirect operand such as [eax + edi] can be passed to the INVOKE directive. 19- Stack parameters are usually expressed as positive offsets from ESP. Part 2 – Short programs: 1- (20 pts) Write a program that correct an extra character in a string. For example, in “Good morrning” program should remove the extra r. . data str1 BYTE “ Good morrning” .code 2- (20 pts) Write a procedure named Str_concat that concatenates a source string to the end of a target string. Sufficient space must exist in the target string to accommodate the new characters. Pass pointers to the source and target strings. Here is a sample call: .data First Name: Last Name: CIS 21J 3 targetStr BYTE "ABCDE",10 DUP(0) sourceStr BYTE "FGH",0 .code INVOKE Str_concat, ADDR targetStr, ADDR sourceStr 3- (20 pts) Create a procedure named FindLargest that receives two parameters: a pointer to a unsigned doubleword array, and a count of the array’s length. The procedure must return the value of the largest array member in EAX. Use the PROC directive with a parameter list when declaring the procedure. Preserve all registers (except EAX) that are modified by the procedure. 4- (5 pts) What will be the final value in EDX after this code executes? mov edx,1 mov eax,7FFFh cmp eax,8000h jl L1 mov edx,0 First Name: Last Name: CIS 21J 4 L1: 5- (5 pts) In the following code sequence, show the value of AL after each shift or rotate instruction has executed: mov al,0D4h ror al,3 ; a. mov al,0D4h rol al,7 ; b. stc mov al,0D4h rcl al,1 ; c. stc mov al,0D4h rcr al,3 ; d. Microsoft Word - Final-CIS21J-2017.docx FirstName: LastName: June26,2017 DeAnzaCollege 1 Part 1- 20 multiple choice questions (each 2 points) 1- For any two integers n and m, ((n XOR m) XOR m) produces n. 2- The TEST instruction always alters the destination operand. 3- XORing an operand with 1 always causes the Zero flag to be set. 4- ANDing an operand with 1 sets the zero flag if the operand was originally an even number. 5- The Parity flag indicates whether the lowest byte of a destination operand has an even number of 1 bits. 6- The XOR instruction inverts each bit in a destination operand. 7- The JBE instruction is used when comparing unsigned integers. 8- The OR instruction can be used to find the intersection of two bit-mapped sets. 9- With unsigned operands, the CMP instruction sets the Carry flag when the destination operand is less than the source operand. 10- With signed operands, the CMP instruction makes the Sign flag equal to the Overflow flag when the destination operand is less than the source operand. 11- The MUL instruction sets the Overflow flag if the upper half of the product is not equal to zero. 12- When the MUL BX instruction executes, the 32-bit product ends into the EAX register. 13- The binary value of AL after the following instructions have executed is 00001101. mov al,01101011b shr al,2 14- The binary value of AL after the following instructions have executed is 11101101. mov al, 01101011b rol al,2 FirstName: LastName: June26,2017 DeAnzaCollege 2 15- The hexadecimal values of DX and AX after the following instructions have executed are DX=0005 and AX=0000. mov dx,5000h mov ax,20h mul dx 16- The following is a valid LOCAL declaration? LOCAL index:DWORD 17- In 32-bit programs, ADDR and OFFSET return the same value. 18- An indirect operand such as [eax + edi] can be passed to the INVOKE directive. 19- The C calling convention requires the calling program to reset the stack pointer after the subroutine has returned. 20- When a subroutine argument is passed by value, the calling program pushes the argument's address on the stack. Part 2- 6 comprehensive problems each 10 points) 1- In the following instruction sequence, show the resulting value of AL where indicated, in hexadecimal: mov al,7Ah not al ; a. mov al,3Dh and al,74h ; b. mov al,9Bh or al,35h ; c. mov al,72h xor al,0DCh ; d. 2- What will be the final value in EDX after this code executes? mov edx,1 mov eax,7FFFh cmp eax,8000h jl L1 mov edx,0 L1: FirstName: LastName: June26,2017 DeAnzaCollege 3 3- What will be the final value in EDX after this code executes? mov edx,1 mov eax,7FFFh cmp eax,8000h jb L1 mov edx,0 L1: 4- In the following code sequence, show the value of AL after each shift or rotate instruction has executed: mov al,0D4h ror al,3 ; a. mov al,0D4h rol al,7 ; b. stc mov al,0D4h rcl al,1 ; c. stc mov al,0D4h rcr al,3 ; d. 5- What will be the contents of EAX and EDX after the following operation? mov eax,123400h mov edx,0 mov ebx,10h div ebx 6- In the following instruction sequence, show the values of the Carry, Zero, and Sign flags where indicated: mov al,00001111b test al,00000010b ; a. CF= ZF= SF= mov al,00000110b cmp al,00000101b ; b. CF= ZF= SF= mov al,00000101b cmp al,00000111b ; c. CF= ZF= SF= First Name: Last Name: CIS 21JA 1 Part 1- 10 multiple choice questions (20 points each) 1- For any two integers n and m, ((n XOR m) XOR m) produces n. 2- The TEST instruction always alters the destination operand. 3- ANDing an operand with 1 sets the zero flag if the operand was originally an even number. 4- The XOR instruction inverts each bit in a destination operand. 5- The JBE instruction is used when comparing unsigned integers. 6- With unsigned operands, the CMP instruction sets the Carry flag when the destination operand is less than the source operand. 7- With signed operands, the CMP instruction makes the Sign flag equal to the Overflow flag when the destination operand is less than the source operand. 8- The MUL instruction sets the Overflow flag if the upper half of the product is not equal to zero. 9- The binary value of AL after the following instructions have executed is 11101101. mov al, 01101011b rol al,2 10- The hexadecimal values of DX and AX after the following instructions have executed are DX=0005 and AX=0000. mov dx,5000h mov ax,20h mul dx This study source was downloaded by 100000846814651 from CourseHero.com on 06-12-2022 17:56:29 GMT -05:00 https://www.coursehero.com/file/59192713/CIS21JA-Final-Winter-2020pdf/ https://www.coursehero.com/file/59192713/CIS21JA-Final-Winter-2020pdf/ First Name: Last Name: CIS 21JA 2 Part 2 – Short programs: 1- (20 pts) Write a program that correct an extra character in a string. For example, in “Excellent time of dday to learn assembly programming” program should remove the extra d. Only you are allowed to use MOVSB, CMPSB, SCASB, LODSB, and STOSB instructions. . data str BYTE “Excellent time of dday to learn assembly programming”,0 .code 2- (20 pts) Write a procedure named Str_concat that concatenates a source string to the end
Answered 5 days AfterJun 12, 2022

Answer To: Hi This is Assembly language, I attack the questions and the book, pls let me know if you can help...

Nidhi answered on Jun 18 2022
86 Votes
Part 2 – Short programs:
1- (20 pts) Write a program that correct an extra character in a string.
For example, in “Good morrning” program should remove the extra r.
. data
str1 BYTE “ Good morrning”
.code
ExitProcess proto,dwExitCode:dword
main proc
mov al, 0
mov edi, offset str1
mov ecx, length str1
cld
repne scasd
jnz L
cmp [edi], al
jmpnz L
mov esi, edi
dec edi
rep movsd
L:
main endp
end main
2- (20 pts) Write a procedure named Str_concat that concatenates a source string to the end of a target string....
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here