Question

16.      What value will be in rax after the following operation(s)             Assume the code will...

16.      What value will be in rax after the following operation(s)

            Assume the code will assemble and run without error

            mov     rax,      0x10

            xor     rdx,     rdx

            mov     rbx,     0x4

            div     rbx

            A.        0x4

            B.         0x2

C.         0x25

            D.        0x0

17.      What value will be in rdx after the following operation(s)

            Assume the code will assemble and run without error

Note: This question is asking about RDX

            mov     rax,      0x10

            xor     rdx,     rdx

            mov     rbx,     0x4

            div     rbx

            A.        0x4

            B.         0x2

C.         0x25

            D.        0x0

18.      What value will be in rax after the following operation(s)

            Assume the code will assemble and run without error

mov     rax,      1010b

mov     rbx,     1100b

and      rax,      rbx

           

            A.        1110

            B.         1000

C.         0111

            D.        0110

19.      What value will be in rax after the following operation(s)

            Assume the code will assemble and run without error

            mov     rax,      1010b

            mov     rbx,     1100b

            or        rax,      rbx

            A.        1110

            B.         1000

C.         0111

            D.        0110

20.      What value will be in rax after the following operation(s)

            Assume the code will assemble and run without error

            mov     rax,      1010b

            mov     rbx,     1100b

            xor      rax,      rbx

A.        1110

            B.         1000

C.         0111

            D.        0110

21.      What value will be in rax after the following operation(s)

            Assume the code will assemble and run without error

            mov     rax,      0xAA

            shr       al,        2          

           
A.        AA

            B.         2A

C.         A8

            D.        EA

            E.         55

0 0
Add a comment Improve this question Transcribed image text
Answer #1

(16)   What value will be in rax after the following operation(s):

mov     rax,      0x10

xor     rdx,     rdx

mov     rbx,     0x4

div     rbx

Answer: (A) 0x4

Description:

mov     rax,      0x10 ; Move the value 0x10 to rax register. rax = 0x10

xor     rdx,     rdx ; Set rdx to 0 value. rdx = 0x0

mov     rbx,     0x4  ; Move the value 0x4 to rbx register. rbx = 0x4

div     rbx ; Divide rax by rbx. Store the result in rax register and reminder in rdx register.

0x10 ÷ 0x4 = 0x4 with reminder 0x0.

rax = 0x4 and rdx = 0x0.

(17)  What value will be in rdx after the following operation(s):

mov     rax,      0x10

xor     rdx,     rdx

mov     rbx,     0x4

div     rbx

Answer: (D) 0x0

Description:

mov     rax,      0x10 ; Move the value 0x10 to rax register. rax = 0x10

xor     rdx,     rdx ; Set rdx to 0 value. rdx = 0x0

mov     rbx,     0x4  ; Move the value 0x4 to rbx register. rbx = 0x4

div     rbx ; Divide rax by rbx. Store the result in rax register and reminder in rdx register.

0x10 ÷ 0x4 = 0x4 with reminder 0x0.

rax = 0x4 and rdx = 0x0.

(18) What value will be in rax after the following operation(s):

mov     rax,      1010b

mov     rbx,     1100b

and      rax,      rbx

Answer: (B) 1000

Description:

mov     rax, 1010b ; Move the value 1010b to rax register. rax = 1010b

mov     rbx, 1100b ; Move the value 1100b to rbx register. rbx = 1100b

and      rax, rbx ;Perform the logical AND between rax and rbx register and store the result in rax register.

1010 AND 1100 = 1000

(19) What value will be in rax after the following operation(s):

mov     rax,      1010b

mov     rbx,     1100b

or        rax,      rbx

Answer: (A) 1110

Description:

mov     rax, 1010b ; Move the value 1010b to rax register. rax = 1010b

mov     rbx, 1100b ; Move the value 1100b to rbx register. rbx = 1100b

or rax, rbx ;Perform the logical OR between rax and rbx register and store the result in rax register.

1010 OR 1100 = 1110

(20) What value will be in rax after the following operation(s):

mov     rax,      1010b

mov     rbx,     1100b

xor      rax,      rbx

Answer: (D) 0110

Description:

mov     rax, 1010b ; Move the value 1010b to rax register. rax = 1010b

mov     rbx, 1100b ; Move the value 1100b to rbx register. rbx = 1100b

xor rax, rbx ;Perform the logical XOR between rax and rbx register and store the result in rax register.

1010 XOR 1100 = 0110

(21) What value will be in rax after the following operation(s):

mov     rax,      0xAA

shr       al,        2      

Answer: (B) 2A

Description:

mov     rax,      0xAA ; rax = 0xAA

shr       al,        2 ; Logical shift right register AL by 2 bits

Logical Shift Right 2 times AL value AA = 1010 1010 → shift → 0010 1010 = 2A

rax = 0x2A value.

Add a comment
Know the answer?
Add Answer to:
16.      What value will be in rax after the following operation(s)             Assume the code will...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Assembly language 64 bit please ! An example file for set up ==========+ ;| Data Segment...

    Assembly language 64 bit please ! An example file for set up ==========+ ;| Data Segment BEGINS Here | ;+======================================================================+ segment .data ;Code this expression: sum = num1+num2 num1 dq 0 ;left operand of the addition operation num2 dq 0 ;right operand of the addition operation sum dq 0 ;will hold the computed Sum value RetVal dq 0 ;Integer value RETURNED by function calls ;can be ignored or used as determined by the programmer ;Message string prompting for the keyboard...

  • Instruction set architecture R: register X, Y, Opl, Op2: Operand Quantity: constant value EA: Effective memory address Opcode Operation Name MOV X, Y XCH Opl, Op2 ADD X, Y SUB X,Y SAL Op, Quantity...

    Instruction set architecture R: register X, Y, Opl, Op2: Operand Quantity: constant value EA: Effective memory address Opcode Operation Name MOV X, Y XCH Opl, Op2 ADD X, Y SUB X,Y SAL Op, Quantity SAR Op, Quantity Shift Arithmetic Right on Op for Quantity SHR Op Quanti AND X, Y OR X, Y XOR X, Y NOT X LOADR, A LOAD R, (A STORE R, A STORE R, (A Description Move data from Y to X Exchange Op1 with Op2...

  • QUESTION 10 What will be the output of following code snippet? char *str; str = "%s";...

    QUESTION 10 What will be the output of following code snippet? char *str; str = "%s"; printf(str, "S"); A. S B. Garbage Value C. Compile-time Error D. Run-time Error 4 points    QUESTION 11 What will be the output of the following statements assuming that the array begins at the memory address location 7002 and size of an integer is 4 bytes? int a[3][4] = { 1, 2, 3, 4,                     5, 6, 7, 8,                     9, 10, 11, 12 }; printf("%d,...

  • 1.   What will be the value of x after the following code is executed? int x...

    1.   What will be the value of x after the following code is executed? int x = 10, y = 20; while (y < 100) { x += y; } A.   90 B.   110 C.   210 D.   This is an infinite loop 2.   If a superclass has constructor(s): A.   then its subclass must initialize the superclass fields (attributes). B.   then its subclass must call one of the constructors that the superclass does have. C.   then its subclass does not inherit...

  • What is the final value of x in memory after the code below is run? 1...

    What is the final value of x in memory after the code below is run? 1 int x; 2 for (x=0; x<5; x++){ 3 4} Answer: Answer What is the result of the following bitwise operation in decimal? ((~6)&36)|(6)&(~36)), where ~, |, and & are the bitwise NOT, OR, and AND respectively. Answer: Answer Complete the attempt to allocate a 5-element array of pointers to doubles and initialise the associated double value to 0.0. double* a[10]; for (int j =...

  • Edit a C program based on the surface code(which is after the question's instruction.) that will...

    Edit a C program based on the surface code(which is after the question's instruction.) that will implement a customer waiting list that might be used by a restaurant. Use the base code to finish the project. When people want to be seated in the restaurant, they give their name and group size to the host/hostess and then wait until those in front of them have been seated. The program must use a linked list to implement the queue-like data structure....

  • What happens when you try to compile and run the following code? String query = "INSERT...

    What happens when you try to compile and run the following code? String query = "INSERT INTO Invoices (InvoiceDate InvoiceTotal) "              + "VALUES ('2/10/01', '443.55')"; Statement statement = connection.createStatement(); statement.executeUpdate(query); a. A SQLException is thrown at runtime because the executeUpdate method can’t accept a String object. b. A SQLException is thrown at runtime because the SQL statement is coded incorrectly. c. An error occurs at compile time because the SQL statement is coded incorrectly. d. This code compiles and...

  • QUESTION 1 What will be displayed as a result of executing the following code? int   x...

    QUESTION 1 What will be displayed as a result of executing the following code? int   x = 5, y = 20; x += 32; y /= 4; cout <<"x = " << x <<"y = " << y; A. x = 32, y = 4 B. x = 9, y = 52 C. x = 37, y = 5 D. x = 160, y = 80 8 points    QUESTION 2 What will be the displayed when the following code...

  • Can you please help me with creating this Java Code using the following pseudocode? Make Change C...

    Can you please help me with creating this Java Code using the following pseudocode? Make Change Calculator (100 points + 5 ex.cr.)                                                                                                                                  2019 In this program (closely related to the change calculator done as the prior assignment) you will make “change for a dollar” using the most efficient set of coins possible. In Part A you will give the fewest quarters, dimes, nickels, and pennies possible (i.e., without regard to any ‘limits’ on coin counts), but in Part B you...

  • Please answer the following in Python: The cost of a travel pass includes a $5 administrative charge and the cost of one unit of trips (or 10 trips) at $1.50 per trip. A passenger who has a tr...

    Please answer the following in Python: The cost of a travel pass includes a $5 administrative charge and the cost of one unit of trips (or 10 trips) at $1.50 per trip. A passenger who has a travel pass can perform these operations make trips as long as there is at least one unconsumed trip, top up in multiples of units of trips without incurring administrative charge get a refund at $1.20 per unconsumed trip C) C) C) When a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT