Question

After the following MASM code is executed: MOV EAX, 212 MOV EBX, 19 CDQ DIV EBX...

After the following MASM code is executed:

  MOV   EAX, 212
  MOV   EBX, 19
  CDQ
  DIV   EBX

What is the value in the EAX register (in decimal)?
What is the value in the EBX register (in decimal)?
What is the value in the EDX register (in decimal)?

Homework Answers

Answer #1

Please up vote ,comment if any query .

Answer :

EAX =11

EBX = 19

EDX = 3

Explanation :

MOV EAX ,212 ; this instruction copy value 212 immediate value into EAX register EAX = 212

MOV EBX ,19 ; This instruction copy immediate value 19 into EBX register EBX = 19

CDQ ; this instruction convert 32 bit EAX to 64 bit EDX : EAX by copying sign bit (bit 31 ) of EAX to every bit position 0 to 31 of EDX

Suppose sign bit bit 31 is 1 of eax register so edx

EDX = FFFFFFFFh

In our program

EAX = 212 0000 0000 0000 0000 0000 0000 1101 0100 in binary

Sign bit is 0 of eax register

EDX = 00000000h

EDX : EAX = 00000000h : 000000D4 h

Next instruction

DIV EBX

this instruction divide the value of EDX : EAX by EBX

EDX : EAX / EBX

Reminder in EDX

Quotient stored in EAX

212/19 quotient = 11 reminder =3

EDX = 3

EAX = 11

EBX = 19

Please upvoe . Comment if any query .

Know the answer?
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
Similar Questions
Let's say the code on the left contains instructions in a virus, and the code on...
Let's say the code on the left contains instructions in a virus, and the code on the right side contains a metamorphic version of the virus code. What is the effect of the metamorphic code? Original code Metamorphic code mov eax, 5 mov eax, 5 add eax, ebx push ecx call [eax] pop ecx add eax, ebx swap eax, ebx swap ebx, eax call [eax] nop aThe virus author retrieves additional information from the host computer. bThe virus author creates...
After running the program below, what will be the values in registers EAX and EBX? mov...
After running the program below, what will be the values in registers EAX and EBX? mov EAX,0123ABCDh       mov EBX,4455AABBh       PUSH BX       PUSH AX       POP AX       POP BX Question 2 options: EAX=ABCD 0123 EBX=AABB4455 EAX= ABCD0123 EBX=4455AABB EAX=0123ABCD   EBX=4455AABB EAX=ABCD0123    EBX=AABB4455
;Assembly x86-64 ;Q9: What is the value of eax (in decimal) after the function call in...
;Assembly x86-64 ;Q9: What is the value of eax (in decimal) after the function call in _start returns? global _start _start: mov edi, 4 call function1 global function1 function1: push rdi inc edi mov esi, 2 call function2 pop rdi mul edi ret global function2 function2: mov eax, edi mov edx, 0 div esi add eax, edi add eax, edx ret ;Q10: A function uses 10 integer arguments. What is the appropriate value for the blank operand to clear the...
What would be the result after the following code is executed? final int SIZE = 25;...
What would be the result after the following code is executed? final int SIZE = 25; int[] array1 = new int[SIZE]; // Code that will put values in array1 int value = 1; for (int a = 0; a < array1.length; a++) { array1[a] = value; value = value + array1[a]; }
A) Is the code below secure? Explain your rationale. ExitProcess PROTO .data firstval qword 20002000h secondval...
A) Is the code below secure? Explain your rationale. ExitProcess PROTO .data firstval qword 20002000h secondval qword 11111111h thirdval qword 22222222h sum qword 0 .code main proc      mov rax,firstval                         add rax,secondval             add    rax,thirdval      mov    sum,rax      mov    ecx,0      invoke ExitProcess main endp end main b) Transmitted messages often include a parity bit, whose value is combined with a data byte to produce an even number of 1 bits. Suppose a message byte in the AL...
7. (True/False): Nested procedure calls are not permitted by the Microsoft assembler unless the NESTED operator...
7. (True/False): Nested procedure calls are not permitted by the Microsoft assembler unless the NESTED operator is used in the procedure definition. 15. What will be the final value in EAX after these instructions execute? push 5 push 6 pop eax pop eax 3. Which instruction pops the stack into the EFLAGS register? 17. Which statement is true about what will happen when the example code runs? 1: main PROC 2: mov eax,30 3: push eax 4: push 40 5:...
Consider the following data segment .data array1 WORD 10 DUP(?),0,0 array2 DWORD 4 DUP(3 DUP(?)) What...
Consider the following data segment .data array1 WORD 10 DUP(?),0,0 array2 DWORD 4 DUP(3 DUP(?)) What decimal value the instruction : mov EBX , SIZEOF array2 stores in EBX. Show your work for full credit.
The following command has been successfully executed: Create Sequence EmpSeq; The following block of PL/SQL code...
The following command has been successfully executed: Create Sequence EmpSeq; The following block of PL/SQL code is executed: Begin     dbms_output.put_line(EmpSeq.NextVal); End; How many of the following statements are false: The anonymous block increments the sequence The anonymous block retrieves the next value from the sequence The anonymous block resets the sequence The anonymous block will not output anything
1) The decimal equivalent of the unsigned 8-bit hex number 0B4H is ______________. 2) The value...
1) The decimal equivalent of the unsigned 8-bit hex number 0B4H is ______________. 2) The value of the expression ‘H’ – ‘B’ is less than / equal to / greater than that of the expression ‘L’ – ‘C’. If the .data segment contains declarations. A BYTE 2 DUP (‘a’), ‘+’ B BYTE 3 DUP (‘b’), 0 C BYTE 4 DUP (‘c’), ‘–’ D BYTE 5 DUP (‘d’), 0 then the instruction input A, D, 6 will display a Windows dialog...
Please answer as soon as possible What's the contents of newNumbers after the following code is...
Please answer as soon as possible What's the contents of newNumbers after the following code is executed? val numbers = Array(2.5, 1, 3.2, 9.3, 2, 9, 1.5) val newNumbers = numbers.map(_.toInt)
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT