Programming > QUESTIONS & ANSWERS > CMPE 102 Shell Programming - San Jose State University - Midterm Exam: SP22: CMPE-102 Sec 04 - Assem (All)

CMPE 102 Shell Programming - San Jose State University - Midterm Exam: SP22: CMPE-102 Sec 04 - Assembly Language Programming. MAY 2022. Correct Answers Highlighted.

Document Content and Description Below

CMPE 102 Shell Programming - San Jose State University - Midterm Exam: SP22: CMPE-102 Sec 04 - Assembly Language Programming. MAY 2022. Correct Answers Highlighted. Midterm Exam: SP22: CMPE-102 Sec 04... - Assembly Language Programming https://sjsu.instructure.com/courses/1479457/quizzes/1571669 1/12 Midterm Exam Due Mar 16 at 11:30am Points 25 Questions 25 Available Mar 16 at 10:30am - May 20 at 11:30am 2 months Time Limit None Requires Respondus LockDown Browser Midterm Exam 11111110 11111110b Question 2 0 / 1 pts The hexadecimal representation of decimal -21 is _____.01011hFFEBFFEBh Question 3 0 / 1 pts What is the sum of the following binary integer? 10101111 + 110110110110100110001010b110001010 5/18/22, 10:40 PM Midterm Exam: SP22: CMPE-102 Sec 04 - Assembly Language Programming https://sjsu.instructure.com/courses/1479457/quizzes/1571669 3/12 Question 4 0 / 1 pts What is the sum of the following hexadecimal numbers? 6A + 4B10CB5hB5 Question 5 0 / 1 pts What is the 8-bit binary (two’s-complement) representation of the following signed decimal integer? -7201110001011100010111000b Question 6 0 / 1 pts The following instructions will set the Overflow flag: mov al,0D7h add al,75h 5/18/22, 10:40 PM Midterm Exam: SP22: CMPE-102 Sec 04 - Assembly Language Programming https://sjsu.instructure.com/courses/1479457/quizzes/1571669 4/12 True er er False Question 7 1 / 1 pts The following instructions will set the Overflow flag: mov al,80h sub al,-5False True Question 8 0 / 1 pts ORing an operand with 1 always causes the Zero flag to be set.truefalse Answer er Question 9 1 / 1 pts ANDing an operand with 1 sets the zero flag if the operand was originally an even number. 5/18/22, 10:40 PM Midterm Exam: SP22: CMPE-102 Sec 04 - Assembly Language Programming https://sjsu.instructure.com/courses/1479457/quizzes/1571669 5/12 true false Question 10 1 / 1 pts The XOR instruction inverts and retains multiple bits in a destination operand at the same time.true false Question 11 0 / 1 pts With unsigned operands, the CMP instruction sets the Carry flag when the destination operand is less than the source operand.falsetrue Answer er Question 12 0 / 1 pts What will be the value in EDX after the following lines execute? .data num WORD 8055h 5/18/22, 10:40 PM Midterm Exam: SP22: CMPE-102 Sec 04 - Assembly Language Programming https://sjsu.instructure.com/courses/1479457/quizzes/1571669 6/12 .code mov edx,21348041h movsx edx, num 21348041h FFFF8055H FFFF8055h FFFF8055 Question 13 0 / 1 pts What will be the value in EAX after the following lines execute? mov eax,1002FFFFh inc ax10010020000H1002000010020000h Question 14 0 / 1 pts What will be the value of the Parity flag (0 or 1) after the following lines execute? mov al,1 add al,3 5/18/22, 10:40 PM Midterm Exam: SP22: CMPE-102 Sec 04 - Assembly Language Programming https://sjsu.instructure.com/courses/1479457/quizzes/1571669 7/12 1 clear Clear 0 Question 15 0 / 1 pts What value will EAX in hexadecimal format contain after the following instructions execute? .data dVal DWORD 12345678h .code mov ax,3 mov WORD PTR dVal+2,ax mov eax,dVal12345683h00035678H0003567800035678h Question 16 0 / 1 pts What value will EAX in hexadecimal format contain after each of the following instructions executes? Use spaces to separate your for 5/18/22, 10:40 PM Midterm Exam: SP22: CMPE-102 Sec 04 - Assembly Language Programming https://sjsu.instructure.com/courses/1479457/quizzes/1571669 8/12 Line 1, Line 2, Line 3, and Line 4. Your answer should look like this: ABCD0001h A0001000h F0000002h 1FFFFFFCh .data var1 SBYTE -4,-2,3,1 var2 WORD 1000h,2000h,3000h,4000h var3 SWORD -16,-42 var4 DWORD 1,2,3,4,5 mov ax,var2 ;Line 1 mov ax,[var2+4] ;Line 2 mov ax,var3 ;Line 3 mov ax,[var3-2] ;Line 4 00000001 00001000 00000002 FFFFFFFC 00000001H 00001000H 00000002H FFFFFFFCH 00000001h 00001000h 00000002h FFFFFFFCh Question 17 0 / 1 pts What will be the final value in EDX in hexadecimal format after this code executes? mov edx,1 mov eax,7FFFh cmp eax,8000h jl L1 mov edx,0 5/18/22, 10:40 PM Midterm Exam: SP22: CMPE-102 Sec 04 - Assembly Language Programming https://sjsu.instructure.com/courses/1479457/quizzes/1571669 9/12 L1: 0 1H 1 1h Question 18 1 / 1 pts Using the following data declaration, write an assembly statement that moves all four bytes in my_bytes to the EAX register. .data my_bytes BYTE 10h,20h,30h,40h _____ _____, _____1/ esi OFFSET my_bytes 2/ mov eax,my_bytes[esi+0] 3/ add eax,my_bytemov eax,DWORD PTR my_bytes mov eax,dword ptr my_bytes Question 19 0 / 1 pts If a bit is not in the set, the zero flag is clear.True er er 5/18/22, 10:40 PM Midterm Exam: SP22: CMPE-102 Sec 04 - Assembly Language Programming https://sjsu.instructure.com/courses/1479457/quizzes/1571669 10/12 False Question 20 0 / 1 pts Write an assembly statement that sets bit 4 of this 8-bit data: 10001000.or 00010000b OR 00010000b Question 21 0 / 1 pts Write an assembly statement that clears bit 2 of this 8-bit data: 10001110.and 11111011b AND 11111011b Question 22 0.5 / 1 pts Write an assembly statement that inverts the upper byte and retains the lower byte of this 16-bit data: ABCDh. 5/18/22, 10:40 PM Midterm Exam: SP22: CMPE-102 Sec 04 - Assembly Language Programming https://sjsu.instructure.com/courses/1479457/quizzes/1571669 11/12 XNOR eax, ABCDh XOR ff00h xor FF00h xor ff00h Question 23 0 / 1 pts Write an assembly statement that uses one of the logical instructions and AL to set the zero flag.CMP AL, 0AND AL,0 and al,0 and al, 0 AND AL, 0 Question 24 0 / 1 pts Write an assembly instruction that uses one of the logical instructions and AL to clear the zero flag.CMP AL,or al,1or al, 1 5/18/22, 10:40 PM Midterm Exam: SP22: CMPE-102 Sec 04 - Assembly Language Programming https://sjsu.instructure.com/courses/1479457/quizzes/1571669 12/12 Question 25 0 / 1 pts Specify an instruction that sets the overflow flag.mov al,7Fh _____ alCMPINC inc [Show More]

Last updated: 2 years ago

Preview 1 out of 12 pages

Buy Now

Instant download

We Accept:

We Accept
document-preview

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

We Accept

Reviews( 0 )

$14.50

Buy Now

We Accept:

We Accept

Instant download

Can't find what you want? Try our AI powered Search

86
0

Document information


Connected school, study & course


About the document


Uploaded On

Apr 23, 2023

Number of pages

12

Written in

Seller


seller-icon
PAPERS UNLIMITED™

Member since 3 years

509 Documents Sold

Reviews Received
55
20
8
2
8
Additional information

This document has been written for:

Uploaded

Apr 23, 2023

Downloads

 0

Views

 86

Document Keyword Tags

More From PAPERS UNLIMITED™

View all PAPERS UNLIMITED™'s documents »

$14.50
What is Scholarfriends

In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·